フィルターのクリア

Assign multiple values to array

2 ビュー (過去 30 日間)
RuiQi
RuiQi 2016 年 6 月 24 日
回答済み: KSSV 2016 年 6 月 24 日
I want to assign different values to different parts of my array like below. 1 to 10 gets assigned 99, end-1 to end gets 98. How can i do it ?
test([1:10 end-1:end]) = [99 98];
test([1:10 end-1:end]) works. I am able to print the output

採用された回答

KSSV
KSSV 2016 年 6 月 24 日
test(1:10) = 99 ;
test(end-1:end)=98 ;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by