How to use selector block to extract a single element from a 1x2 matrix?

3 ビュー (過去 30 日間)
RevengeOfTee
RevengeOfTee 2020 年 2 月 12 日
回答済み: Siriniharika Katukam 2020 年 2 月 17 日
Hello. I have the matrix [1;1]. How do I use the selector block to extract the first element only? I tried going to the page for the block but it went over my head. Sorry if this is a basic question.
  1 件のコメント
Bhaskar R
Bhaskar R 2020 年 2 月 12 日
Do you mean
mat = [1;1];
extract_single_element = mat(1); % first element of the matrix mat?

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

回答 (1 件)

Siriniharika Katukam
Siriniharika Katukam 2020 年 2 月 17 日
Hi,
A selector block is one which selects the input based on the parameter set in the block. To get the first element of the input you are passing, you need to select the parameter “Index Option” as Index Vector(dialog) and then specify which index of input has to be selected and set even the other parameters of selector block appropriately.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by