Why does my data have more than 2 dimensions?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
C Kroeger
el 24 de Mzo. de 2017
Comentada: ilyes louahem m'sabah
el 10 de Mzo. de 2022
I used the "Data Logging" tool in Simulink to collect the outputs of a model, but there seems to be a dimensions problem with one of them.
I extracted the values of the different signals using
>>test=logsout.getElement(1).Values.Data;
but when trying to plot it, I get "Error using plot. Data cannot have more than 2 dimensions." While other signals have the format 18001x1 double, this one has the format 1x1x18001 double. When typing the signal name in the command window, the values look like this:
>>test
test(:,:,204) =
4.2991
test(:,:,205) =
4.2156
test(:,:,206) =
4.2530
How can I convert the Signal to a "normal" one (just the values)?
0 comentarios
Respuesta aceptada
Más respuestas (1)
dbmn
el 24 de Mzo. de 2017
There is multiple options to force your 3d data into a vector
Option 1: use dot notation
% gets you a column vector
a(:) = test(1,1,:);
% gets you a row vector
b(:,1) = test(1,1,:);
Option 2: Shape to your likings
c = reshape(test, [numel(test), 1]);
2 comentarios
Ver también
Categorías
Más información sobre Outputs en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!