Unable to perform assignment because the size of the left side is 360-by-1 and the size of the right side is 360-by-360.
1 次查看(过去 30 天)
显示 更早的评论
Hello, I am trying to store numbers from an equation into a new matrix. Below, is the issue code.
asis_d = abs(l_asis(:,2) - r_asis(:,2));
hip_d = abs(l_hip(:,2) - r_hip(:,2));
hip_percent(:,2) = ((0.14*(asis_d))/hip_d) + ((0.5*(hip_d - asis_d))/hip_d);
"Unable to perform assignment because the size of the left side is 360-by-1 and the size of the right side is 360-by-360."
In the first line, I am creating a matrix named asis_d that takes all the numbers in the second column of r_asis and subtracts them from all the numbers in the second column of l_asis. Similarly in the second line, but with the hip variables.
Then, in the third line I am trying to create a new matrix column that stores the results of the equation with each row of number from those columns. So for example, the numbers in the first row of the second column for asis_d and hip_d will get put into the hip_percent equation and give me a new number that I want to store in the first row of hip_percent. And then so on for the second and third and all the numbers in column two of asis_d and hip_d, storing them in their respective column (or row?) in hip_percent.
Why is it creating a 360x360 matrix on the right side instead of a 360x1 matrix? and how can I fix this?
Thank you.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!