Error in find command....
조회 수: 1 (최근 30일)
이전 댓글 표시
t=linspace(xq(1),xq(np),1001)
y2=polyval(pmon,t)
plot(t,y2,'k--',x)
for j=1:6
for i=1:1001;
t1(j)=find(y2(i)=pmon(j))
end
end
i want to find value of t(x axis) for which value of pmon(y axis) is given ??
댓글 수: 2
Adam Danz
2019년 3월 14일
Have you implemented the correction suggested in the answers section below?
If you've implemented that correction and 't' is empty, that means there were no matches between y2(i) and pmon(i).
답변 (1개)
Adam Danz
2019년 3월 14일
One equal sign assigns a value to a variable.
Two equal signs perfoms a comparison between A and B and returns a logical value.
t1(j) = find(y2(i) = pmon(j)) %incorrect
t1(j) = find(y2(i) == pmon(j)) %correct
댓글 수: 12
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!