From: Ernur on
Hi Umut,

I've had the same problem before, i.e. the one about the parent workspace. Hopefully, you solved it by now, but just in case you or anyone else encounter the same problem...

In my case, it was caused by the fact that the variables (defined as non-tunable parameters) I'd defined were not loaded for Simulink to see them before the simulation started. Simulink simply didn't know where they were defined. I was using callback functions for a Simulink model so that some constant parameters were loaded before the simulation started. My problem was solved when I used my initializing .m file as the InitFcn callback (instead of StartFcn).

Hope it helps...

Regards,
Ernur Karadogan

"umut arioz" <john.doe.nospam(a)mathworks.com> wrote in message <hisak9$a42$1(a)fred.mathworks.com>...
> Also, I changed my codes. I summed all the algorithms of the blocks to one embedded block. so no same inputs and outputs. all calculations were made within the block.
>
> comp_ratio=comp_rate/100;
>
> comp_range=comp_region2-comp_region1;
>
> t=0:(comp_range*comp_ratio/comp_range):(comp_range*comp_ratio);
>
> And I defined the problematic data (comp_ratio, comp_region2, comp_region1) as parameter with non-tunable check from ports and data manager :
>
> but now, the error message was
>
> Embedded MATLAB Runtime Error: Error evaluating Embedded MATLAB parameter data 'comp_rate' (#157) in its parent workspace.
>
> what could be the wrong with my way ?
>
> thanks
>
> umut