The grid vectors must contain unique points & Error using unique function
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I have a range of θ want to put into the equation as below, but it comes out error "The grid vectors must contain unique points". I found out that M would be deplicated when θ >0.024 rad. So, I added the unique function as below, but it still has error "X and V must be of the same length". How should I revise the code?
Before adding unique function:
After adding unique function:
2 comentarios
David Hill
el 13 de Ag. de 2020
The problem is in your functions calls to interp1 or griddedInterpolant. You need to show more code or use Matlab help to make sure the inputs to these functions are correct.
Respuestas (1)
Ayush Gupta
el 3 de Sept. de 2020
The unique function returns the same data as is passed inside it but with no reeditions. The moment vector contained some repetition of values. So, when we call unique on moment only the unique values are stored in M. Maybe because in the interp1 function the size of both theta and M vector must be same but which is not the case anyone because unique function is applied on the vector. This the reason why it throws the error. The documentation of unique function can be accessed here.
0 comentarios
Ver también
Categorías
Más información sobre Logical 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!