How to loop over a customized function?
이전 댓글 표시
Hello everyone,
I wrote a function and I would like to use it on many data at once, so I tried to use the function inside a for loop.
But I got this error
In an assignment A(:) = B, the number of elements in A and B must be the same.
Kindly find the function and my code attached with sample files.
I appreciate your help.
Note: put all the files in the same folder and run the file "semimanual_matching.m".
Basically, I need to run this line
T(n) = V2(dinfo(n).name, V(n));
for several text files, For instance, the function "V2" will run for the first text file "dinfo(1).name" and will take the first value of "V(1)" and put the result in the first cell of "T" ---> T(1).
Currently the error is
Subscripted assignment dimension mismatch.
Error in semimanual_matching (line 12)
T(n) = V2(dinfo(n).name, V(n));
댓글 수: 4
Jim Riggs
2019년 12월 21일
I cannot find a line of code with "A(:) = B"
Mohamed Nedal
2019년 12월 21일
per isakson
2019년 12월 21일
편집: per isakson
2019년 12월 21일
I miss an instruction on how to use your files. And I miss the file matlab.mat, which is loaded in the first line of the second section of semimanual_matching.
What release of Matlab are you running?
Mohamed Nedal
2019년 12월 21일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!