Why can´t i do this? (C-Code doubt)
显示 更早的评论
Hello,
If i have as a S-Function parameter:
variable1 (with value 0)
And i have an input (u) and an output (y). I want to do this:
double variable3 = 0,*var,*input,*last;
input = &u[0]; /* u[0] is the Simulink block input */
last = &variable1;
var = &variable3;
*var = *input - *last;
if (variable3 > 0){
y[0] = *input; /* y[0] is the Simulink block output */
*last = *input; ---> This line doesn´t work!, Why?
}
else
y[0]=0;
I´m trying to implement this code in a S-Function.
Thanks!
回答(1 个)
Jan
2012-10-7
0 个投票
Is u a const variable, while last is not?
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!