how to write equation in matlab?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
i have an equation as attached in file that i am trying to write in matlab but something being wrong, please help how to write???
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167133/image.png)
2 Kommentare
Geoff Hayes
am 11 Sep. 2017
ajeet - is there anything more to this equation? Is r0 a matrix or a function? If a matrix, then presumably x and y are integers and so your equation could be written as
x = 1;
y = 2;
r0 = rand(4,4); % sample data to illustrate problem
r = zeros(4,4);
R = 1;
r(x,y) = 2 * round((R - 1) / 2) + ((-1)^(R + 1)) * r0(x,y);
But how is R used. You mention that R is equal to 1,2,3,4. Does this mean that you have 4 matrices (of r) where you use different values of R. Or is have you omitted a summation? Please clarify.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!