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!