Undefined operator '*' for input arguments of type 'matlab.graphics.primitive.Line'.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
anant mehrotra
el 7 de En. de 2020
Comentada: anant mehrotra
el 24 de En. de 2020
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);
3 comentarios
Nicholas Ayres
el 7 de En. de 2020
Could you please clarify what the variable
b
is. Maybe insert the code where it is defined into your question (and respond to me saying you have done so, so that I get the notification).
If I am not mistaken, it appears that b is taken from a graphics handle and you are just incorrectly indexing it to find the data point you are requiring.
Knowing what b is would help me more directly answer your question.
:)
Respuesta aceptada
anant mehrotra
el 7 de En. de 2020
Editada: anant mehrotra
el 7 de En. de 2020
8 comentarios
Steven Lord
el 23 de En. de 2020
Set an error breakpoint. Run your code. When you reach the line where the error gets thrown, look at the class of the variable b. I'm pretty sure it will not be a numeric vector but will be a graphics object created by the plot or line functions.
If that's the case, start searching backwards in your code or use the dbstop function to set a breakpoint to determine exactly where in the code the plot function gets called. As stated in the description of the file input on that documentation page, "If file is not a MATLAB code file (for instance, it is a built-in or MDL-file), then MATLAB issues a warning. MATLAB cannot pause in the file, so it pauses before executing the file."
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Type Identification en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!