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

1 view (last 30 days)
??? 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.

Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!