Can Matlab do this without using a for loop?
Show older comments
Hi, I'm new to Matlab and need some help. I'm using a for loop to calculate all Rs from all combination of A and B. How can I do that?Can Matlab do this without using a for loop?
this is my code
A=(-15:0.175:-1); B=(8:0.1:16);
R = zeros(81);
for i = 1:8
for j =1:81
C = A(i)* erf(x) + B(j);
R = (y-C).^2;
end
end
end
thanks,
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!