Calling a script into another script

조회 수: 3 (최근 30일)
panacean
panacean 2018년 2월 16일
답변: Walter Roberson 2018년 2월 16일
I have a bunch of structs set up in separate scripts. I'd like to call those scripts into another script, then put the structs from those files into a another struct. So how would I call a struct from another file and stick that in a new struct?
field1 = 'Driver'; value1 = 'sally';
field2 = 'weight'; value2 = 110;
field3 = 'Top Speed'; value3 = 62;
field4 = '2 Top SPeed'; value4 = 3.8417; %SVSU Time to top speed 4.8812 TOP SPEED 85 MPH
FSAE = struct(field1,value1,field2,value2,field3,value3,field4,value4,pp,sf,sr,wf,wr);
disp(FSAE);
This my code, where pp,sf,wf,wr are scripts that contain structs.

답변 (1개)

Walter Roberson
Walter Roberson 2018년 2월 16일
Just run the script and the output will appear in your current workspace.

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by