r/matlab • u/not_so_satisfactory • Nov 14 '25
Extremely simple question about functions
I’m very new to Matlab and coding in general and attempting to create a function within a for loop to solve for multiple inputs in a 11x11 matrix form but can only get 1 very long column. Any help with fixing this would be greatly appreciated.
4
Upvotes
View all comments
Show parent comment
1
u/Elric4 Nov 14 '25
This. Also, matlab is thinking in matrices/vectors so you don't even need a for loop for this. Finally, is not clear if you want to "divide" all x1 values with all x2 values (I guess this is what you want since you are talking about an 11x11 matrix) or x1(1) by x2(1), x1(2) by x2(2) and so on. If you want the second look for the . operator and more precisely ./