recalling the values as a row matrix

조회 수: 1 (최근 30일)
Offroad Jeep
Offroad Jeep 2015년 9월 16일
댓글: dpb 2015년 9월 17일
Hi to all, the program attached satisfy the conditions. now I want that the values which are obtained for theta can be seen all together, when i write theta it tells only the last value........ e.g, for example the loop has n values till reaching the final condition, so when i write theta i can see like this
theta = n1 n2 n3 till nn
what command should i write to get all the values on screen........ Thanks in advance............
  댓글 수: 2
Walter Roberson
Walter Roberson 2015년 9월 17일
The logic of that code is strange. With your code
theta1 = theta+dtheta(i)
if theta1 > theta
that is going to be true only if dtheta(i) > 0 . If that is what you want to test, why not test it more directly?
Offroad Jeep
Offroad Jeep 2015년 9월 17일
Any other good idea please..........

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

답변 (1개)

dpb
dpb 2015년 9월 16일
Preallocate theta before the loop...
theta=zeros(1,nmc);
Then, store each value when computed by writing
theta(i)=...
where you currently only have
theta=...
  댓글 수: 2
Offroad Jeep
Offroad Jeep 2015년 9월 17일
Can you please correct in the program........ Its giving error to me
dpb
dpb 2015년 9월 17일
Show your work and the error(s) you get...

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by