How to use a from workspace function for a 1D lookup table

9 次查看(过去 30 天)
Hello everyone,
I want to have 2 inputs and 2 ouputs for a 1D lookup table so that afterward I can subtract the two outputs from each other. I found online that you can do this by using a vector. When I do it with a vector, it works (figure 1) but when I want to use a vector that I made in the matlab workspace from 2 variables, it gives an error (figure 2). I really need to use the from workspace fuction because in a further proces, the variables from the input wil come from previous calculations and can't be inserted manually each time. Does anyone of you know how to fix this problem and properly use the from workspace function?
Thanks in advance!!
Figure 1
Figure 2

采纳的回答

Paul
Paul 2023-3-20
Dose input_grafiek have a constant value over the entire simulation run? If it does, don't use a From Workspace block. Instead, use a Constant block and enter 'input_grafiek' (without the single quote marks) in the field 'Constant value'. Then, when you run the simulation it will use whatever the value is for input_grafiek as defined in the Matlab base workspace.
If input_gafiek is a 2D array representing a function of time, then you can use a From Workspace block with an array input, but the first column in the array has to be a time vector. More discussion starting at this doc page.
  1 个评论
Hannah
Hannah 2023-3-20
input_grafiek does have a constant value over the entire simulation run. I replaced it with a constant block and it works, thank you very much!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Clocks and Timers 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by