Importing a non-time series table from Excel into Simulink

Hi all,
I am using Matlab R2012b version and I have an Excel table with two columns: Battery SoC from 0% to 100% in steps of 1% and corresponding current value for each SoC level. I would like to select an appropriate current value for controlled current source based on battery SoC e.g. if SoC input is 50% then I would need Simulink to go to the Excel table look up SoC=50% and select the appropriate value for current variable. I have tried using various Lookup table blocks but I have not managed to import the data from Excel into the lookup table, therefore I was wondering whether there is a better way of doing it. The equivalent in Matlab would be
filename = 'leaf.xlsx'; A = xlsread(filename); Current= A(A(:,1)==SoC,2);
I tried using this code with Matlab function block in Simulink but it did not work.
Help much appreciated
Thanks
Joonas

Answers (0)

Categories

Asked:

on 29 Oct 2014

Community Treasure Hunt

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

Start Hunting!