how to creat this vector K?

A=[1 3 9 10 -1 4 5 2 3 15 1];
B=[10 15] and his index [4 10]
how to creat this vector k?
K=[NaN NaN 9 10 -1 NaN NaN NaN 3 15 1]

3 件のコメント

Rik
Rik 2021 年 1 月 30 日
You mean you want to find the indices of the values of B in A and then keep 1 to either side? Your question is fairly poorly stated.
It is also unclear what you have tried yourself. You're doing the OnRamp, have you re-read the instructions before this assignment?
benghenia aek
benghenia aek 2021 年 1 月 30 日
I just look for the values before and after the max in vector A
Rik
Rik 2021 年 1 月 30 日
That is a different question. Do you want to find the maximum value? Then you should read the documentation for the max function. Matlab has very good documentation, it is one of the things I consider being an advantage over their competition.

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

回答 (0 件)

カテゴリ

タグ

質問済み:

2021 年 1 月 30 日

コメント済み:

Rik
2021 年 1 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by