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
2 个评论
Paul
2023-3-19
In Figure 1, the input [6 9] is in a Constant block. In Figure 2, is input_grafiek in a Constant block?
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Clocks and Timers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!