Please help. How to solve this m-scripting error?

1 Ansicht (letzte 30 Tage)
Rizwana
Rizwana am 2 Jul. 2015
Bearbeitet: Walter Roberson am 2 Jul. 2015
??? Error using ==> add_block
Invalid destination block specification.
This is my script and creating a model to add block into it.
I am reading a '.xlsx' file;
sys = 'testModel';
new_system(sys)
open_system(sys)
filename = 'abc.xlsx';
[x,y]= xlsread(filename);
[row,col]= size(y); // [38,4]
i = 1: col // 1: 4
m= y(:,i); // y(:,1) reads 1st full column
n = m'; // arranging the column in vector matrix for ease
k = length(n) // 38
for 1 = 1: k // 1: 38
count = 0;
x = 30+count;
y = 30+count;
w = 30+count;
h = 30+count;
pos = [x y+h/4 x+w y+h*.75]
add_block('built-in/Inport',[sys n(k)],'Position',pos);
count = count+10;
end
iam getting this error:
??? Error using ==> add_block
Invalid destination block specification.

Antworten (0)

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by