Extrating elements from array

8 ビュー (過去 30 日間)
guru k
guru k 2020 年 3 月 9 日
回答済み: Ameer Hamza 2020 年 3 月 9 日
my case is like this
x=[1:0.1:100];
y=x^2;
in this case if I need only certain data x and y range from x= .5 to x=0.8 and plot those x and y how to do?
I need array data of x and y for the range using index
kindly help in this regard

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 3 月 9 日
There are several ways to create numbers in a specific range, one of them is following,
x = linspace(0.5, 0.8, 100); % specify the range and number of points
y=x.^2;
plot(x, y);

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by