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?

Antworten (1)

Andrei Bobrov
Andrei Bobrov am 4 Sep. 2017
Bearbeitet: Andrei Bobrov am 5 Sep. 2017
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;

Kategorien

Gefragt:

am 4 Sep. 2017

Bearbeitet:

am 5 Sep. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by