我有以下代碼要獲取result
result=zeros(1,100)
i=0
for x=0:0.5:50
i=i 1
mat=[-12,4,4;4,6,-x-10;-8,-1,-x]
con=[-120;0;-240]
X = linsolve( mat,con)
result(1,i)=X(3,1)
end
我嘗試繪制x=0:0.5:19
及其對應的result
y=result(1:39)
xlabel('resistance'), ylabel(' through the fuse') % Set the label on the corresponding axis
y=result(1:39)
x=0:0.5:19
plot(x, y) % plot the values of x and y as a line plot
scatter(x, y) % plot the values of x and y in a scatter plot
xline(x), yline(y) % draw a vertical / horizontal line at the specified value
但它顯示錯誤...
uj5u.com熱心網友回復:
在這一行:
y=result(1:39)
你有一個偽造的字母,:
這不是 ASCII 字符:
,它是一個引起問題的 Unicode 字符U FF1A
,只需替換它就可以了。
y=result(1:39)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/519538.html
標籤:matlab