Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Function outputs the top row of a matrix, need it to output whole matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
The function that is outputting incorrectly is the myBisection function. mySpringScaleFunction is required for it to function.
I want the function to output a whole matrix [gather], but it only outputs the top row of the matrix.
댓글 수: 0
답변 (2개)
Andrew Reibold
2014년 11월 18일
편집: Andrew Reibold
2014년 11월 18일
You have a counter here, but its not actually in a loop. I'm guessing thats a mistake. Count only ever equals 1 during assignment, so that means you are only populating the first row.
gathered(count,:) = count;
gathered(count,2) = xl;
gathered(count,3) = xu;
gathered(count,4) = xm;
gathered(count,5) = errorz;
gather = gathered;
counters = count +1;
Also should the first line be (count,1) intead of (count,:)??
EDIT: OR - If count is supposed to be passed out, then back in, you aren't passing out the NEW value of count out anywhere. Every time you recall the function count is whatever is in the input. The +1 isn't doing anything as written.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!