Undefined function 'C' for input arguments of type 'double'.

1 visualización (últimos 30 días)
nines
nines el 2 de Mzo. de 2021
Comentada: Walter Roberson el 3 de Mzo. de 2021
hello!
i am running into a problem with my script with this line:
whole_ts = {1:2150, 1:1928, 1:2426};
I've tried:
whole_ts = [{1:2150, 1:1928, 1:2426}];
whole_ts = (1:2150, 1:1928, 1:2426);
whole_ts = [C{1:2150, 1:1928, 1:2426}];
whole_ts = timeseries([1:2150], [1:1928], [1:2426])
this one seems the most promising:
whole_ts = [C{1:2150, 1:1928, 1:2426}];
where i am getting this error:
Undefined function 'C' for input arguments of type 'double'.
I am trying to load it into a cell like I did with the 'trs' variable which is 1x3 but 'whole_ts' has is [1:2150, 1:1928, 1:2426].
%% loading TACS
subj = {'subj01' 'subj02' 'subj03'}
trs = [2.8, 2.2, 2.2];
whole_ts = [C{1:2150, 1:1928, 1:2426}];
for k = 1:3
ts{k} = load(fullfile(D,subj{k},'ts','thalamus_ts.txt'));
whole_ts = 1:length(ts{k})
t_mr_1 = (1:length(whole_ts))*(trs(k)/60)
subplot(3,1,k), hold on
plot(t_mr_1, ts{k})
end
Any help would be much appreciated!
  8 comentarios
nines
nines el 3 de Mzo. de 2021
I don't think anything really, except that for some reason this:
whole_ts = [C{1:2150, 1:1928, 1:2426}];
is telling me that indexing is not supported with the C function.
do you have any suggestions on how to plot indexes:
plot(t_mr_1{k},ts{k}) %now i cannot plot this as a graph
I am getting an error that says the the vectors are not the same length, although they are.
Walter Roberson
Walter Roberson el 3 de Mzo. de 2021
Where did you get the C part from? Why are you expecting it to be there?
whole_ts = {1:2150, 1:1928, 1:2426};
Your file looks like it might be a 2D array instead of a vector. If so then you have to be very careful when you use length() as length(X) is defined as:
temporary = size(X);
if any(temporary == 0)
length is 0
else
length is max(temporary)
end
That is, length is 0 if any dimension is 0, and otherwise length is the largest dimension, no matter which one it is.
However, when you ask to
plot(t_mr_1{k},ts{k})
then if ts{k} is a 2D array, then MATLAB would try to plot every column as a separate line, and the length of t_mr_1{k} would have to be the same as the number of rows in ts{k} .

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Biomedical Imaging en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by