How can I fix this error message: Unable to perform assignment because the left and right sides have a different number of elements?
1 view (last 30 days)
Show older comments
I try to call a function on my Matlab script, but when I start the simulation, I have this message: 'Unable to perform assignment because the left and right sides have a different number of elements' for the function: 'intersection1sph2' as you see in the code. How can I fix it?
Code:
No1a(1) = 20; Qo1a(1) = 20;
for k = 1:1:1800
% call of intersection's function : a (o1,a) 1s [LEAVEo1al(k),LEAVEo1at(k),LEAVEo1ar(k),No1a(k+1),Qo1a(k+1)] = intersection1sph2(ENTERo1al(k),ENTERo1at(k),ENTERo1ar(k),No1a(k),Qo1a(k),k); LEAVEo1a(k) = LEAVEo1al(k) + LEAVEo1at(k) + LEAVEo1ar(k);
end
1 Comment
Answers (1)
Sulaymon Eshkabilov
on 19 May 2019
Hi,
As stated by Walter, it is necessary to have a look at your function file: intersection1sph2 without it - it is just a guess to play with k and k+1 index values and assignments.
Good luck.
0 Comments
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!