Error "Error using Delaunay Data points in complex number format are not supported. Use REAL and IMAG to extract the real and imaginary components."
Mostra commenti meno recenti
Hi Matlab Team,
I have generated 500 parameters, by lhsdesign, which is a matrix 500 * 15 size, I call it "LHSparametertable".
Now, I put them as an input to my code (to run 500 times), to receive the output. I need some parameters to be integer, so I use floor function, to receive the integer part of them. Something like this:
[my_output] = my_function( floor(LHSparametertable(i,j)), LHSparametertable(i,j+1)...);
In my function, I use delaunay, but when I run the code, (in one of this 500 times) I received this error, while I do not have any complex number, is the problem with floor? If so, how can I just use the integer part of the number without using floor?
Error using delaunay
Data points in complex number format are not supported.
Use REAL and IMAG to extract the real and imaginary components.
Thanks
5 Commenti
"while I do not have any complex number..."
Most likely you do.
"...is the problem with floor?"
No, the problem is that your code generates complex numbers.
Solution: find out why your code generates complex numbers.
x = rand([20,1]);
y = rand([20,1]);
delaunay(x,y+1i)
Neda
il 25 Ott 2024
Walter Roberson
il 25 Ott 2024
You created a number of inputs using lhsdesign .
There are several possibilities here:
- lhsdesign might have somehow generated complex values. I do not see how this could be possible. If it is happening it would be interesting to test with 'Smooth', 'off'
- You are extracting two or three columns from LHSparametertable and passing those directly to delaunay but delaunay is complaining about complex values even though the inputs are definitely completely real. If so.. strange!
- Most likely: you are using the values from LHSparametertable to compute something, and you are passing that something to delaunay but delaunay is complaining about complex values. In this case, you need to check the process of computing whatever it is you pass to delaunay.
You could use the debugger to stop at the delauny call, and save the inputs to a .mat file and attach the .mat file here for testing.
Neda
il 27 Ott 2024
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Triangulations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!