MATLAB: Undefined operator ‘*’ for input arguments of type ‘matlab.gr​aphics.pri​mitive.Lin​e’.

'matlab.graphics.primitive.line'MATLABpyhton scripting

Hello, I am working on Python scripting to make changes over the proposed DoE in Matlab in order to make changes in the model and obtain the results.
When I am passing commands to make changes in the cell structure, I get the error mentioned above. I have tried looking further but I think it has to do with some mathematical oepration on a graphical database which aren't comptabile to work together. But I can't find any other way to make changes in the diemension of my cell.
The problem is when I am trying to define the printf statement whererin I want to write the new data to my text file(pyhton model database script) and then change my mdoel in the abaqus (in background).
Any help is much appreciated. I have described the exact lcoation of error in the text below:::
Problem is mainly in this section and line highlighted in the text below towards the end where I am assigning the value " 0.5 * b(1) "
replaceLine=144;
fid=fopen('BASE_MODEL_MDB.py','r+');
for k=1:(replaceLine-1)
fgetl(fid);
end
fseek(fid,0,'cof');
fprintf(fid,' ''Model-1'', RectangularProfile(a=1.0, b=%5.4f, name=''Profile-2''), ', 0.5*b(1)); %HERE
fclose(fid);

Best Answer

Nicholas Ayres sure I can help you with that. I am going to attach two files which will help you in understanding what b is. The problem is, earlier I wasn't using variable b and I was simply calling it cell_section and assigning values to it as per my DoE (generateDoE.m). And I was using the same in "printf" statement to modify my model in ABAQUS. Everytime I would run the main code, it gave me an error that cell_section is not defined or unknown variabel/function.
So what I did next is to call the variables I am changing with the same name the ABAQUS uses, maybe that could bring this error of graphical and assigning this mathematical value. But anyway, I am attaching the matlab code here.
"python_assembly.m" is called inside "Main.m" which is called inside "DoE.m".
I hope this helps and thank you for your prompt response.
Related Question