配列のサイズを動的に設定して値を格納しようとしていますが、エラーが発生しています。
ここにコードがあります、
syms k
x=[1 0 0 1];
y=[];
for b=1:4
step1= x(b)*exp(-2*pi*1i*k*((b-1)/length(x)));
y(b)=step1
end
私がやろうとしているのは、step1 の各値を配列 'y' に格納することです。
ここにエラーがあります。
The following error occurred converting from sym to double:
Error using mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double
array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in Untitled3 (line 6)
y(K)=1/exp((pi*k*3*1i)/2)