Writing data from multiple scopes in Simulink to an excel file?

Hi
I have used "to workspace" function and saved the data as x and y variables.
I know I can use the following to export one scope and save it in excel. But how do I change this so it does both of them at the same time?
A= [tout,x];
save file.xls A -ascii
Thanks

 Respuesta aceptada

James, simply append the second data vector to the matrix
A = [tout,x,y];
save file.xls A -ascii
where x and y are the two data arrays from the two scopes.

4 comentarios

James Murray
James Murray el 20 de Abr. de 2014
Editada: James Murray el 20 de Abr. de 2014
Thanks. I just tried doing that and it gives me an error "Error using horzcat Dimensions of matrices being concatenated are not consistent."
I looked at y and it seems like for some reason y matrix is 1x1x153 and x is 153x1. But when I click on y it only shows me one value for each and this is what I need to see. Is there any way to fix this?
Without having access to your model, it's impossible to say what is going on and why. However, you can resolve the dimension mismatch by using squeeze
A = [tout,x,squeeze(y)];
save file.xls A -ascii
assuming tout has the same number of rows as x (153).
Please have a look at my other question I just posted.
By the way that command fixed it. Thanks

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 20 de Abr. de 2014

Comentada:

el 20 de Abr. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by