在command window运行时会显示
请问高手 该怎么改正啊???十分感谢!!!
开始时是
N=input('Please input a number')
......
之后在function script里做个方程:y(i)=i/log(i)
做出的图横坐标是从1到N(之前输入的数)
纵坐标是y(N)得出的值
像这样:
请问高手改如何做啊???真的很急!本人是菜鸟!十分感谢!!!
请问:
我是想作图出来的
类似这样的
请问该怎样改啊?多谢!
x=2:1000;
y=x./log(x);
plot(x,y)
这样就可以了。
我需要的x的数值不是固定的,是由main script中的N=input('Please input a number')决定的,所以方程是y=x./log(x);
x=2:N
plot(N,y)
可是还是出不来……
function y=func2(N)x=2:N;
y=x./log(x);
plot(x,y)将上面语句保存为func2.m文件。 再在command window输入下面命令
N=input('Please input a number: ');func2(N)