In the "Section 5 - Further Practice" of MATLAB Onramp, it is stated that, "Indices can be non-consecutive numbers. Try extracting the first, third, and sixth elements of density.". How to do it ?

6 ビュー (過去 30 日間)
Anushka Tilekar
Anushka Tilekar 2020 年 5 月 27 日
回答済み: Renad Saad 2020 年 11 月 12 日
In the "Section 5 - Further Practice" of MATLAB Onramp, it is stated that, "Indices can be non-consecutive numbers. Try extracting the first, third, and sixth elements of density.". How to do it ?

回答 (2 件)

Lan Lou
Lan Lou 2020 年 9 月 1 日
You would use:
p=density([1 3 6],:)
or
p=density([1 3 6],end)
or
p=density([1 3 6],1)
  2 件のコメント
Jon Wagner
Jon Wagner 2020 年 9 月 18 日
p=density([1 3 6],1) is correct. this gives the 1st 3rd and 6th element of column 1. since elements start at the top of the first column and move down, then to top of next column.
vashisht kant
vashisht kant 2020 年 10 月 17 日
all three are correct since there is only one column

サインインしてコメントする。


Renad Saad
Renad Saad 2020 年 11 月 12 日
how to do the further practice ???

カテゴリ

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

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by