need to isolate column in matrix from function file for graph

1 回表示 (過去 30 日間)
kat
kat 2014 年 3 月 1 日
コメント済み: Image Analyst 2014 年 3 月 1 日
i have a 25 by 26 matrix set up to solve for support forces, and solved by rref with the numbers i need as b=(:,26)
this is in a function file because a certain force varies and changes multiple equations... i have it running as a for loop
for n=linspace(0,7500)
Ai(2,26)=n; Ai(5,26)=n; Ai(6,26)=n; Ai(9,26)=n; Ai(10,26)=n; Ai(13,26)=n; Ai(15,26)=n+8000; Ai(17,26)=n; Ai(19,26)=n; Ai(21,26)=n+10000*sind(60);
Bi=rref(Ai); Bi(:,26);
the b matrix gives me what i want number wise, but i need to graph the forces for each member over the variance and i can't seem to pull it out correctly....at best i can get a single dot.
  1 件のコメント
kat
kat 2014 年 3 月 1 日
編集済み: kat 2014 年 3 月 1 日
gladly. Bi actually varies with respect to n....Bi is just what i called the rref of the Ai....the i is only to tell me it has factored in the variable.
the prompt is that i'm looking at support forces when varying weight is added to a truss
so Bi(1,26) spits out all of the values for the first member, with the varied weight added in

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2014 年 3 月 1 日
I can't make any sense of your code. If you're plotting Bi and Bi is just a scalar, perhaps you mean B(i) so that you index into an array and create an array for B. But it's hard to follow your code. Maybe you can attach your m-file and data.
  2 件のコメント
kat
kat 2014 年 3 月 1 日
errrr ....it appears that i added it to the original question as a comment, but code is attached there
Image Analyst
Image Analyst 2014 年 3 月 1 日
The code makes little sense. first of all it doesn't seem to return any value(s). Then you're passing in n as a user supplied input argument but then just overwrite it when you do this:
for n=linspace(0,7500)
Then, that line is not normally how you do a for loop (though you can). linspace makes an array of 100 (the default number because you didn't supply any number) values going from 0 to 7500, inclusive. What did you want? Did you want n to take on values from 0 to 7500 in steps of 1, or what? Then, why are you passing in n when you just ignore it? Was the passed in n supposed to be the upper limit of the for loop?
How are you calling ice? Show me the line in the script or command line that you use to call it.
It's hard for me to fix your code when I don't know what is to be done.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by