How to loop over a customized function?
Afficher commentaires plus anciens
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 commentaires
Jim Riggs
le 21 Déc 2019
I cannot find a line of code with "A(:) = B"
Mohamed Nedal
le 21 Déc 2019
per isakson
le 21 Déc 2019
Modifié(e) : per isakson
le 21 Déc 2019
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
le 21 Déc 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Type Identification dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!