series with empty entrys
1 回表示 (過去 30 日間)
古いコメントを表示
Hi I have a series (double) with the demension of 61x1. I want to enlarge it to 63x1 with the last two values to be empty. How can I do this? Many thanks
0 件のコメント
回答 (2 件)
Jos (10584)
2014 年 5 月 21 日
編集済み: Jos (10584)
2014 年 5 月 21 日
Each element in a double array has to be set to something. It cannot be empty.
You can use NaN (or maybe also zero) as a place-holder to make the array having a particular size
A = 1:3
B = 10:10:50
% Now, I want A to have two extra elements, because B has
% 5 elements, and I want to add each element of A to the
% corresponding element of B
A(4:5) = NaN
C = A + B
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!