Can someone help me with this assignment?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
i'm using MatLab grader
2 件のコメント
Rik
2018 年 11 月 10 日
Have a read here (or here for more general advice) and here. It will greatly improve your chances of getting an answer. You can find guidelines for posting homework on this forum here.
Maryam AlKhoury
2018 年 11 月 10 日
編集済み: madhan ravi
2018 年 11 月 10 日
fa=@(x) (2.*x.^3+3.*x.^2-6.*x+19)./(7.*x.^3-20.*x-5); % define the function for part (a)-REMEMBER to use element-by-element operations (.* ./ .^)
x=[-10 -100 -1000 -10000 -100000 -1000000 -10000000]; % define the vector x
ya=f(x) % calculate f(x) (No semicolon to see output)
syms x; % DO NOT CHANGE CODE ON THIS LINE
aLimit=limit( ) % No semicolon
% Repeat the above process for part (b)
fb=@(x) sqrt(4.*x.^2+7.*x+1)-2.*x;
x=[10 100 1000 10000 100000 1000000 10000000];
yb=f(x)
syms x;
bLimit=limit( )
this is my code... i dont know how to choose the values of x and what to write in "ya= "
採用された回答
madhan ravi
2018 年 11 月 10 日
編集済み: madhan ravi
2018 年 11 月 17 日
fa=@(x) (2.*x.^3+3.*x.^2-6.*x+19)./(7.*x.^3-20.*x-5); % define the function for part (a)-REMEMBER to use element-by-element operations (.* ./ .^)
x=[-10 -100 -1000 -10000 -100000 -1000000 -10000000]; % define the vector x
ya=fa(x) % calculate f(x) (No semicolon to see output)
syms x; % DO NOT CHANGE CODE ON THIS LINE
aLimit=limit((2.*x.^3+3.*x.^2-6.*x+19)./(7.*x.^3-20.*x-5),x,-inf ) % No semicolon
% Repeat the above process for part (b)
fb=@(x) sqrt(4.*x.^2+7.*x+1)-2.*x;
x=[10 100 1000 10000 100000 1000000 10000000];
yb=fb(x)
syms x;
bLimit=limit( sqrt(4.*x.^2+7.*x+1)-2.*x,x,inf)
command window:
>> COMMUNITY
ya =
0.2382 0.2814 0.2853 0.2857 0.2857 0.2857 0.2857
aLimit =
2/7
yb =
1.7025 1.7449 1.7495 1.7499 1.7500 1.7500 1.7500
bLimit =
7/4
>>
22 件のコメント
madhan ravi
2018 年 11 月 10 日
Rik
2018 年 11 月 10 日
@Madhan, congratulations for reaching the 2k rep level, especially in such a short time.
madhan ravi
2018 年 11 月 10 日
@Rik thank you very much :)
Maryam AlKhoury
2018 年 11 月 17 日
it says that there's an error at line 3 ya=f(x)
madhan ravi
2018 年 11 月 17 日
Try
clear all %at the very beginning
and try again
I got the result!
madhan ravi
2018 年 11 月 17 日
see edited answer
Maryam AlKhoury
2018 年 11 月 17 日
i tried that but i still get the same error
madhan ravi
2018 年 11 月 17 日
編集済み: madhan ravi
2018 年 11 月 17 日
upload the code that you are trying , did you try my answer ?
Maryam AlKhoury
2018 年 11 月 17 日
i tried substituting values for ya and yb and this is what i got
madhan ravi
2018 年 11 月 17 日
i edited my answer please try again
Maryam AlKhoury
2018 年 11 月 17 日
i got the same answer as you but for some reason i got this error:
madhan ravi
2018 年 11 月 17 日
please upload the code that you are trying becausse you should be getting any error
Maryam AlKhoury
2018 年 11 月 17 日
fa=@(x) (2.*x.^3+3.*x.^2-6.*x+19)./(7.*x.^3-20.*x-5) ; % define the function for part (a)-REMEMBER to use element-by-element operations (.* ./ .^)
x=[-10 -100 -1000 -10000 -100000 -1000000 -10000000]; % define the vector x
ya=fa(x) % calculate f(x) (No semicolon to see output)
syms x; % DO NOT CHANGE CODE ON THIS LINE
aLimit=limit((2.*x.^3+3.*x.^2-6.*x+19)./(7.*x.^3-20.*x-5),x,-inf) % No semicolon
% Repeat the above process for part (b)
fb=@(x) sqrt(4.*x.^2+7.*x+1)-2.*x;
x=[10 100 1000 10000 100000 1000000 10000000];
yb=fb(x)
syms x;
bLimit=limit(sqrt(4.*x.^2+7.*x+1)-2.*x,x,inf)
Maryam AlKhoury
2018 年 11 月 17 日
and this is my output:
ya =
0.2382 0.2814 0.2853 0.2857 0.2857
aLimit =
2/7
yb =
1.7025 1.7449 1.7495 1.7499 1.7500
bLimit =
7/4
madhan ravi
2018 年 11 月 17 日
編集済み: madhan ravi
2018 年 11 月 17 日
This is my output when i tried your answer , your getting error because you should be getting 7 elements but instead your are getting 5
>> COMMUNITY
ya =
0.2382 0.2814 0.2853 0.2857 0.2857 0.2857 0.2857
aLimit =
2/7
yb =
1.7025 1.7449 1.7495 1.7499 1.7500 1.7500 1.7500
bLimit =
7/4
>>
madhan ravi
2018 年 11 月 17 日
or try
format longg
at the very beginning of your code
Maryam AlKhoury
2018 年 11 月 17 日
this is my output (7 elements) but i still get an error:
ya =
0.2382 0.2814 0.2853 0.2857 0.2857 0.2857 0.2857
aLimit =
2/7
yb =
1.7025 1.7449 1.7495 1.7499 1.7500 1.7500 1.7500
bLimit =
7/4
madhan ravi
2018 年 11 月 17 日
You have met all the requirements but why is it showing an error?
Maryam AlKhoury
2018 年 11 月 17 日
yeah i dont know
madhan ravi
2018 年 11 月 17 日
Better ask your teacher maybe he has set an unique algorithm ?
Maryam AlKhoury
2018 年 11 月 17 日
yeah okay.. thanks anyways for your help
madhan ravi
2018 年 11 月 17 日
Glad could help upto a certain , not satisfied though
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB Mobile Fundamentals についてさらに検索
タグ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
