A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

Matlab could someone help me write the code %want to store the particular solution in xp. initialize xp set it to be the zero column vector with decent dimension using the pivot columns from A generate pA solve for pA*temp=b where temp is a temporary vector using pA\b put temp in the positions of xp output xp

  • This Question is Open
  1. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    function csolve(A,b) [x,z]=size(A); pivot=[]; free=[1:1:z]; rreform = rref(A); for i=1:1:x for j=1:1:z if (rreform(i,j)==1) pivot=[pivot,j]; break; end end end free(pivot)=''; rank = length(pivot); fprintf('the rank of the coefficent matrix is %d.\n',rank); fprintf('the pivot variables are'); for i=1:1:length(pivot) fprintf('x%d',pivot(i)); end fprintf('.\n'); fprintf('the free variables are'); for j=1:1:length(free) fprintf('x%d',free(j)); end fprintf('.\n'); end

  2. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    this is my current code runs and works fine

  3. UsukiDoll
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    *runs*

  4. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ? @UsukiDoll

  5. UsukiDoll
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    I'm not too good at matlab...I'm just happy that I passed Deterministic Modeling a.k.a Mathematical Biology and I don't have to do matlab.

  6. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    oh ok:/ @UsukiDoll

  7. UsukiDoll
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    sorrrrrrrrry D:

  8. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    its ok! @UsukiDoll im sure someone will help lol

  9. UsukiDoll
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    usually it's @dan815 or @Kainui who are good at matlab but they never seem to respond and all the other matlab helpers don't show up here that often :/ But I think there's a site called stackoverflow that has online help for matlab

  10. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    oh okay ill try that thanks!

  11. UsukiDoll
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    http://stackoverflow.com/questions/tagged/matlab

  12. dan815
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Hi, still need help?

  13. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yes please @dan815

  14. dan815
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    and what do you have left to do?

  15. UnkleRhaukus
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    if you like a nice print you might want spaces: ` ...variables are ');` | here and some commas, | ``` ... fprintf('x%d, ... end fprintf('\b\b.\n') ... ``` using `\b` to delete the last comma (backspace)

  16. UnkleRhaukus
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @lljenjenll, the code you have posted does seems to work fine, but it hard to see how it matches with the question, all the variable names are different

  17. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.