writing a matrix without loop
Show older comments
Dear all I want to write a matrix that its arrays are dependent on i and j, could I write it without writing loops. my arrays are something like it a(i,j)=sin(2*pi*(i-1))/((sin(2*pi*(i-1))+sin(2*pi*(j-1))))). Thanks
Accepted Answer
More Answers (1)
Laura Proctor
on 23 Dec 2012
Yes, you can create this matrix without using a loop. Use array based mathematical expressions such as ./ and .*
a = sin(2*pi*(ii-1))./(sin(2*pi*(ii-1))+sin(2*pi*(jj-1)));
Categories
Find more on Loops and Conditional Statements 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!