Unable to perform assignment because the left and right sides have a different number of elements. Is it due to the vector stuff? How to solve it. Thanks in advance

a=1:1:5;
I=zeros(2,length(a));
for ii=1:1:length(a)
set_param('A/T','CL',num2str(ii))
sys=power_steadystate('A');
I(ii)=sys.Yss_Measurements;
end

 採用された回答

meghannmarie
meghannmarie 2019 年 12 月 5 日
I has the size of 2x(length(a)). When you are setting I you are only indexing the second dimension. What is the size of sys.Measurements?
If the size is 2x1 try this:
I(:,ii) = sys.Yss_Measurements;
If the size is 1, then you either need to set it to:
I(1,ii) = sys.Yss_Measurements;
or
I(2,ii) = sys.Yss_Measurements;

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

L
L
2019 年 12 月 5 日

編集済み:

L
L
2019 年 12 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by