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!