Error in 'From Spreadsheet ' Block in Simulink

I have 4948 samples in the excel sheet with two columns, first column to be treated as time ad second column to be treated as data. But as soon I press OK after linking the spreadsheet to 'From Spreadsheet' block it results into so many ports instead of just one data port. Tried on MATLAB 2018b.
Thank You in Advance.

Respuestas (1)

Sugar Daddy
Sugar Daddy el 1 de Jun. de 2020

0 votos

Because the sheet you are feeding is row vector (i.e. it has 1 row and 4948 columns), while MATLAB requires column vector (i.e. 4948 rows and 1 column). So take transpose of excel sheet

9 comentarios

DARSHAN N KANNUR
DARSHAN N KANNUR el 1 de Jun. de 2020
Yeah, as you can see first column is treated as time ad second column is treated as data.
Sugar Daddy
Sugar Daddy el 1 de Jun. de 2020
so is the problem resolved?
DARSHAN N KANNUR
DARSHAN N KANNUR el 2 de Jun. de 2020
not yet
Sugar Daddy
Sugar Daddy el 3 de Jun. de 2020
when you select Sheet1 of test1.xlsx
you will see this
change it to Sheet2
DARSHAN N KANNUR
DARSHAN N KANNUR el 3 de Jun. de 2020
Actually there is another problem while rumming the simulation. Help me out.
Sugar Daddy
Sugar Daddy el 3 de Jun. de 2020
open excel file vel.xlsx. what is the name of sheet? if it is Sheet1 replace Sheet1 in from spreadsheet block
For example
The file i provided has 2 sheets i.e. Sheet1 and Sheet2
Now suppose that i change the Sheet1 name in excel to My_sheet1 and now run the code
The error will occur that Sheet "Sheet1' not found.
So in such a case what should i do, i need to tell from spreadsheet block to read My_sheet1 which exists in excel and not some non existing sheet
Double click from spreadsheet block and change sheet name to the new name of your Sheet
DARSHAN N KANNUR
DARSHAN N KANNUR el 3 de Jun. de 2020
when i changed the name of the sheet to sheet2, again the same type of problem block with so many ports.like i have mentioned in the first doubt.
Sugar Daddy
Sugar Daddy el 4 de Jun. de 2020
please attach the sheet if possible
DARSHAN N KANNUR
DARSHAN N KANNUR el 9 de Jun. de 2020
Editada: Rik el 5 de Ag. de 2020
Hello sir I have attached the excel sheet. Do check it.
Edit Rik:
Moved attachment from separate answer to this comment.

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 1 de Jun. de 2020

Editada:

Rik
el 5 de Ag. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by