Plotting certain values of a matrix
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hello I have a 100x1 matrix and would like to plot n=2 and n=100 values against x how would I go about doing this? Thanks for any help
採用された回答
madhan ravi
2019 年 3 月 17 日
plot(repmat(100,100,1),x)
% ^^^-—-—-n
hold on
plot(repmat(2,100,1),x)
9 件のコメント
Josh
2019 年 3 月 17 日
How do I use my N=100x1 matrix in this method?
madhan ravi
2019 年 3 月 17 日
Not clear what your trying to do.
Josh
2019 年 3 月 17 日
I have a matrix 'N' which is 100x1, I would like to plot the second and last value against x. How do I do this?
madhan ravi
2019 年 3 月 17 日
編集済み: madhan ravi
2019 年 3 月 17 日
size(x) ?
plot(N([1 end]),x([1 end]))
Josh
2019 年 3 月 17 日
Sorry I don't follow, it didn't seem to work, what do the 1's and end's do? Sorry very new to Matlab.
madhan ravi
2019 年 3 月 17 日
編集済み: madhan ravi
2019 年 3 月 17 日
Sorry it was supposed to be :
[2 end] % second and last element
Josh
2019 年 3 月 17 日
Thanks think I got it now. Sorry one more thing, how could I add another line to this plot? eg: 'y' It is a bit confusing.
madhan ravi
2019 年 3 月 17 日
編集済み: madhan ravi
2019 年 3 月 17 日
'y' represents color of the plot which is yellow.
See my original answer after using hold on plot another line to the same figure
doc hold
doc plot
I suggest you to do MATLAB onramp course which is free and takes few hours to complete by then you will get know the basics of MATLAB.
Josh
2019 年 3 月 17 日
Thanks for the help
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Graphics Performance についてさらに検索
参考
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)
