MATLAB Answers

0

using a table in a "from workspace block" in simulink

Asked by Tobias Wzl on 5 Dec 2017
Latest activity Commented on by Tobias Wzl on 11 Dec 2017
Hello everyone,
for my Thesis I developed a control in simulink to control my heating elements.
for the control and the parameters I need for the regulation of the whole system, I want a table which appears when I double click on the §from workspace"-block. the table should contain 6 columns(Port-Number,ID, P(stationary), P(transient), Ohm, Voltage) and 12 rows.
Each row is for one PWM-Port of my Arduino.
The configurated table should be saved as an .xlsx, so if I have to measure again with the same parameters I just can use the block "from spreadsheet" for the control
I already developed a table for my needs itself, but how can I include this table into the block or how can I get this done in general?
I hope you understand what I'm asking ^^ and can help me with my problem
thank you for your support :)

  0 Comments

Sign in to comment.

1 Answer

Answer by Nick Choi
on 8 Dec 2017
Edited by Nick Choi
on 8 Dec 2017

If the data is loaded into MATLAB as a table, you could import the signal data using a 'From Workspace' block on the column or row data points. As described in the following documentation link, a MATLAB table is not a supported input format and you would need to have the data as a matrix or a timeseries in order to properly use the block:
If you are trying to access data from an Excel spreadsheet and you want to make use of the row/column names, a 'From Spreadsheet' block would be more suitable for this application. If you click on the icon next to the 'Sheet Name' dialog parameter of the block, you can view the contents of the raw Excel file to specify the range of data that you want to use:
Double-clicking on the 'From Spreadsheet' block to visualize its content is not a feature of the block. You could look into masking the block or adding model callback functions if you wanted to try adding additional functionality.

  1 Comment

Thank you for your answer! :)
I think the "from spreadsheet"-block will be the best way how to do it.
But could you help me with a few more questions concening this block.
I've read a lot of stuff now and by now I know the the first column ist always for the time and the following columns are for the signals. (Hope I got that right)
I created a spreadsheet with following columns wich are necessary for me. (attached)
ID is for the Place I attach my Heating element Nr.1 for example heat sink 1 or something like that.
If I put a number in the stationary column I want to do this for like infinite time for the heating element.
If I put a number in the transient column then I want for example a Power of 25W for like 20sec after that a Power of 40W for like 40sec and so on...
Resistance and Voltage columns are just for information of the heating element
And something I also don't understand is how can I get this done for more than one heating element? Because I understood, that one spreadsheet in my case is just for one heating element.
I hope you can understand what I want to realize ^^
thank you for your help

Sign in to comment.