- Posts: 34
SAM SDK automation using Matlab
- Mohammed Alfailakawi
- Topic Author
Less
More
08 Feb 2021 14:41 #9271
by Mohammed Alfailakawi
SAM SDK automation using Matlab was created by Mohammed Alfailakawi
I am trying to automate a solar power tower (SPT) model in Matlab using the SDK.
My goal is to loop the SPT model multiple times using an array of inputs for some variables, e.g. c_atm_0.
I modified the already existing command based on one single value as follows:
a0= [-0.000558728];
ssccall('data_set_number', data, 'c_atm_0', a0);
To a command which I thought can take an array of values as follows:
a0= [-0.000558728; -0.000347126; -6.89E-05; 4.73E-05];
ssccall('data_set_array', data, 'c_atm_0', a0);
However, I got this message in the Matlab command window:
precheck input: variable 'c_atm_0' (<array>) of wrong type, <number> required.
Can you please help me change this single value based set up in order for the model to accept multiple values.
Thanks in advance.
Regards,
Mohammed
My goal is to loop the SPT model multiple times using an array of inputs for some variables, e.g. c_atm_0.
I modified the already existing command based on one single value as follows:
a0= [-0.000558728];
ssccall('data_set_number', data, 'c_atm_0', a0);
To a command which I thought can take an array of values as follows:
a0= [-0.000558728; -0.000347126; -6.89E-05; 4.73E-05];
ssccall('data_set_array', data, 'c_atm_0', a0);
However, I got this message in the Matlab command window:
precheck input: variable 'c_atm_0' (<array>) of wrong type, <number> required.
Can you please help me change this single value based set up in order for the model to accept multiple values.
Thanks in advance.
Regards,
Mohammed
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
11 Feb 2021 12:20 #9280
by pgilman
Replied by pgilman on topic SAM SDK automation using Matlab
Hi Mohammed,
In this case, the data type of c_atm_0 is a number, so you can not assign an array value to it.
The following should all work
Thanks,
Paul.
In this case, the data type of c_atm_0 is a number, so you can not assign an array value to it.
The following should all work
Code:
ssccall('data_set_number', data, 'c_atm_0', -0.000558728);
Code:
a0 = -0.000558728;
ssccall('data_set_number', data, 'c_atm_0', a0);
Code:
a0= [-0.000558728; -0.000347126; 6.89E-05; 4.73E-05];
ssccall('data_set_number', data, 'c_atm_0', a0(1));
Thanks,
Paul.
Please Log in or Create an account to join the conversation.
- Mohammed Alfailakawi
- Topic Author
Less
More
- Posts: 34
14 Feb 2021 09:01 #9289
by Mohammed Alfailakawi
Replied by Mohammed Alfailakawi on topic SAM SDK automation using Matlab
Dear Mr. Gilman,
Thanks a lot for your reply, I really appreciate your help and support.
Thanks for the confirmation, I believe I have a better understanding now.
Thanks a lot.
Regards,
Mohammed
Thanks a lot for your reply, I really appreciate your help and support.
Thanks for the confirmation, I believe I have a better understanding now.
Thanks a lot.
Regards,
Mohammed
Please Log in or Create an account to join the conversation.
Moderators: pgilman