求大神解答一下matlab中標記出二次函式中函式值大於特定值點的演算法問題

時間 2021-10-28 11:31:12

1樓:匿名使用者

for x=(1:100) 寫法有問題,for x1=1:100 , 前面變數x已有賦值,不能覆蓋了(第乙個圖畫不出)

迴圈內部 y>=5000也有問題...

clear all;

x=0:100;

y=x.*x;

plot(x,y,'b');

hold on;

y_count=0;

y_loc=zeros(1,10);

for x = 1:100

if y(x) >=5000

y_count=y_count+1;

y_loc(y_count) = x;

endend

plot(y_loc(1:y_count),y(y_loc(1:y_count)),'r*');

2樓:思孕

x=0:100

y=x.*x

y_count=0;

for x=(1:100)

if y(x)>=5000

y_count=y_count+1;

y_loc(y_count)=x;

endend

plot(x,y,'b');

hold on;

plot(y_loc(1:y_count),y(y_loc(1:y_count)),'r*')

matlab、簡單一元二次函式計算繪圖程式設計問題

3樓:匿名使用者

x(1)=0.1*rand(1,1);

y(1)=0.1*rand(1,1);

a=2;

b=2.5;

for i=2:20000

x(i)=a*y(i-1)*sin(x(i-1));

y(i)=abs(x(i-1))-b;

endplot(x,y);

最後結果,不明白可追問。

求英語大神解答一下,求英語大神解答一下!

大毛頭和小卷毛 晨讀 has turned working 求英語大神解答一下. 大毛頭和小卷毛 第一課時 i.1,price 2,total 3,field 4,prper 求英語大神解答一下 大毛頭和小卷毛 71,is it nice to wear this kind of clothes?7...

求英語大神解答一下,求英語大神解答一下! 200

recognise 動詞,確認,認識 teenage,青少年 responsibility 文中意思,責任感aid 幫助,援助 contact 保持聯絡 type 型別 graduation 文中意思 畢業晚會challenge 挑戰 in shock 驚嚇,嚇壞了 as if 似乎 易景龍 小猿搜...

求大神解答一下C語言問題,求大神解答一下這道c語言題目

聽不清啊 原來的程式沒有問題啊!不過程式可以簡化的 include int main scanf d n for i 0 i for i 0 i for i 0 iprintf d d n a i b i return 0 求大神解答一下這道c語言題目 printf c c n s1.c 0 s1....