Effacer les filtres
Effacer les filtres

Error in port widths or dimensions. Output port 1 of 'xxx/From File' is a one dimensional vector with 1 elements.

40 vues (au cours des 30 derniers jours)
Hi, Got a little problem in 'FROM FILE' block in simulink.
In my system I've added 'FROM FILE' block which gets data from file and then performs calculation using 'MATLAB FUNC' block. When I tried to open '.mat' file (from which the 'FROM FILE' block extracts data) in MATLAB it imports as 2X20 array. But When I try to run in Simulink I get the following error:
"Error in port widths or dimensions. Output port 1 of 'xxx/From File' is a one dimensional vector with 1 elements."
Thanks in advance.

Réponses (1)

Kaustubha Govind
Kaustubha Govind le 20 Juin 2013
The data in the file needs to be a certain format (first row is treated as time samples, following rows as data). Make sure you conform to the one of the formats as described in the documentation.
  4 commentaires
Kaustubha Govind
Kaustubha Govind le 21 Juin 2013
Could you paste the format of your data here please.
Christian Narvaez
Christian Narvaez le 9 Jan 2015
Modifié(e) : Christian Narvaez le 9 Jan 2015
I am also running into this error here. I tried both as suggested by Kaustubha: ie.
1, 2, 3, 4,
120, 121, 122, 123
where the first row is the time samples and the second row the data and also that matrix transposed. I have no luck either way. Seems like a simple thing to do but it has become a hassle to get past this error.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by