Hi everyone,
I don’t know if anybody has experienced this error or is experiencing this error.
Array indices must be positive integers or logical values.
Error in ps_plot (line 1963)
** maxph=phsort(round(length(phsort)*.999));**
Hi everyone,
I don’t know if anybody has experienced this error or is experiencing this error.
Array indices must be positive integers or logical values.
Error in ps_plot (line 1963)
** maxph=phsort(round(length(phsort)*.999));**
check this parameter
ref_radius: Inf
return it to Inf and see if the error persists
hellow? Have you solute the problem?
Hello.I encountered the same problem when using ps_plot to draw the deformation rate. Have you solved this problem.
Sir, I set the parameter to Inf, but there is still an error.
Array indices must be positive integers or logical values
Error in ps_plot (line 1963)
*Maxph=phsort (round (length (phsort) . 999))
How can I solve this problem? Thank you!
Sir, have you solved this problem? I am still troubled by this problem.
Hello! The error message you’re encountering in MATLAB, “Array indices must be positive integers or logical values,” typically occurs when you try to access an array element with an index that is not a positive integer or logical value. In the context of your code:
maxph = phsort(round(length(phsort)*.999));
The issue might be with the round function. If length(phsort)*.999 results in a non-integer value, round should convert it to the nearest integer. However, if this calculation results in 0 or a negative number, it would cause the error you’re seeing.