Undefined function 'dts_cast_with_warning' for input arguments of type 'matlab.ui.Figure'.

2 visualizaciones (últimos 30 días)
Hello,
I'm implementing a function in mex file (on GPU) in MALTLAB. But I faced with the following error in MATLAB:
Undefined function 'dts_cast_with_warning' for input arguments of type 'matlab.ui.Figure'.
Error in BPmimo2C (line 98)
figure
Error in test (line 29)
BPmimo2C_mex( Efield, f_par, xyz_par, TX, TY, numT, numR)
Here is where this error occurred (in the "figure" part):
...
...
...
for j = 1:numel(z)
hf(j,:,:) = z(j);
end
figure %************** here is where the error occurred
% figure(1);
er = squeeze(max(image,[],1));
h = surf(squeeze(uf(1,:,:)),squeeze(vf(1,:,:)),er);
colormap(jet);
set(h,'LineStyle','none');
view(2);
Please help me solve this problem.
Thank you

Respuestas (1)

Ayush
Ayush el 16 de Jul. de 2024
From the error message shared by you it looks like MATLAB calls function named "dts_cast_with_warning" when the built-in "figure" function is called in the provided code snippet. This might be due to some internal issue or conflict with your MATLAB environment.You can try the following workarounds for resolving this issue:
1. Recheck for custom functions names that are being repeated in your codebase specifically "figure" or "dts_cast_with_warning"
2.Clear your workspace to remove any cache files to avoid any potential conflicts. You can use the following commands to perform the same:
clear all;
close all;
clc;
restoredefaultpath;
rehash toolboxcache;
3. Check for the MATLAB Path of the "figure" function to ensure that there are no other similar named functions in the workspace and the built-in function is being called. You can leverage the following command for the same:
which figure -all
4. Lastly you can try explicitly calling the built-in figure function using the "built-in" function call in MATLAB. You can refer to the following documentation:
If the issue still persists, you can try updating your MATLAB to the latest version as well since any underlying bugs or issues could be fixed. Hope this helps!

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by