double Conversion to double from struct is not possible.
古いコメントを表示
Error using ==> double
Conversion to double from struct is not possible.
clc;
clear all;
x = load('S_chest.mat');
y = load('S_abdomen.mat');
A=zeros(size(x));
A(1,1)=x(1);
for n= 2:5955
A(n,1)=x(n);
A(n,2)=x(n-1);
end
What's wrong with that?
回答 (1 件)
Andrei Bobrov
2017 年 9 月 4 日
編集済み: Andrei Bobrov
2017 年 9 月 5 日
x1 = load('S_chest.mat');
y1 = load('S_abdomen.mat');
x = x1.x;
y = y1.y;
A=zeros(size(x));
A(1,1)=x(1);
for n= 2:5955
A(n,1)=x(n);
A(n,2)=x(n-1);
end
or
x1 = load('S_chest.mat');
x = x1.x;
n = numel(x);
k = 5955;
A = toeplitz([x(1:k);zeros(n - k,1)],[x(k) 0]);
A(k+1,2) = 0;
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!