Asked by Nguyen The Man
on 30 Sep 2011

Hi all,

I need to use Simulink with altera modelsim v6.6c. But when I use command **vsim('socketsimulink', 4449)**, I get errors below

??? SWITCH expression must be a scalar or string constant.

Error in ==> hdlsim>l_GetModelSimLibInfo at 549 switch (lfmVer)

Error in ==> hdlsim at 113 case 'ModelSim', libInfo = l_GetModelSimLibInfo;

Error in ==> vsim at 101 hdlsim(pvpairs{:});

How can I fix this error? I use Matlab R2010a

Thanks a lot!

Best Regards!

Answer by Nguyen The Man
on 30 Sep 2011

I know that, but how i solve this problem? I can't edit that file, and I don't know what i must do with that file. Please explain more clearly

Thanks you

Fangjun Jiang
on 30 Sep 2011

http://www.mathworks.com/help/toolbox/edalink/ref/vsim.html

Answer by Walter Roberson
on 30 Sep 2011

vsim('socketsimulink', '4449')

That is, the socket information must be supplied as a string.

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 2 Comments

## Kaustubha Govind (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/17107#comment_37995

What is the output of this command when you run it in MATLAB:

[s, fullver] = system('vsim -version')

## Nguyen The Man (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/17107#comment_38057

this is result of this command

s =

0

fullver =

Model Technology ModelSim ALTERA STARTER EDITION vsim 6.6c Simulator 2010.08 Aug 24 2010