its not taking the values of y when y value is ranging from 0.25 to 0.45 with an interval of 0.05,but it is able to take the value when y value is constant. and its coming in some matrix but with constant values.

Y1 = 7.7054
Y2 = 9.6584
I(3)= -0.0043
I(4)=0.4141
n=4 ;
m=2;
y=0.25:0.05:0.45;
for j=1:m
for i=1:n
if (j==1)
ud(i+1,1)=y;
taub(i+1,1)=y;
ud(i+1,2)=(I(3)*exp(Y2*y)+I(4)*exp(-Y2*y)+k2)^0.5;
taub(i+1,2)=(f*ro*ud(i+1,2)^2)/8;
end
end
end
ud
taub
plot(ud(i,1),ud(i,2))
sir here y will be my first column and ud will be my second column,bt ud is dependent on y,y is varying from 0.25 to 0.45 by having an interval of 0.05. here i just want to change the value of y in each iteration.

댓글 수: 7

Shouldn't you be using y(i) instead of y alone in the lines
ud(i+1,1)=y;
taub(i+1,1)=y;
ud(i+1,2)=(I(3)*exp(Y2*y)+I(4)*exp(-Y2*y)+k2)^0.5;
Also what is k2?
k2 =
0.3292
but I am unable to plot the graph between y and ud,can you please find out the way so that it can be done.
But we don't know if y should really be y(j) or y(i). y has 5 elements, not 2 or 4 like m and n.
y is y(i),plz try to find the table containg 1st column as y and 2nd column of ud values.if it is possible then plz send it to my mail. n thx for replying me
Is "the table" what you call "taub"? And by "find" you really mean "assign"? Or do you really mean "find" as in search for, or identify the location of?
table does nt mean taub,and i said 'find' that means i want to ve my data in a tabular format. that too the table should contain 2 columns,one for the value of y and the 2nd column for ud.there is nothing related to taub(its a different variable).

댓글을 달려면 로그인하십시오.

 채택된 답변

In your assignment
ud(i+1,1)=y;
the left hand expression "ud(i+1,1)" is a single element, whereas the right hand expression "y" is a list of numbers. This will not work.
What should ud look like when i equals 1?

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2014년 1월 23일

댓글:

2014년 1월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by