How can i plot all the values of y1 and y2 from for loop on x and y axis?

1 次查看(过去 30 天)
clc
clear all
for i =1:100
for j=1:100
y1= (sqrt(i*i+4*j*j-36))/9
y2= (log(i/j))+i
end
end

回答(1 个)

KSSV
KSSV 2019-2-20
编辑:KSSV 2019-2-20
clc
clear all
y1 = zeros(100,100) ;
y2 = zeros(100,100) ;
for i =1:100
for j=1:100
y1(i,j)= (sqrt(i*i+4*j*j-36))/9 ;
y2(i,j)= (log(i/j))+i ;
end
end
plot(y1,y2,'.r')

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by