Using cell fun to extract data from a cell containing objects
Ahora está siguiendo esta pregunta
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
Se ha producido un error
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
0 votos
Comparte un enlace a esta pregunta
2 comentarios
Comparte un enlace a este comentario
Respuesta aceptada
0 votos
Comparte un enlace a esta respuesta
10 comentarios
- calling a function clear is a bad idea. Readers of your code may think you're trying to call the built-in clear (which is overrused by beginners).
- global variables are extremely discouraged in standard non-OOP programming. in OOP programming, there's absolutely no need for them. Use class properties.
- deleting elements of an array while you're looping over its elements is going to fail. Imagine you have the array [1 2 4 6 8] and you'd like to delete all even values with a loop as you've done:
- I don't understand why you've got a for loop wrapped in a while loop.
- In my answer, the reason I use brackets in [shoot(1:i-1).x] in the hypot call is because shoot(1:i-1) is an array. The [] converts the comma separated list returned by shoot(1:-1).x back into an array. See Stephen's comment for more links on comma separated lists. However, if you do shoot(i).x, shoot(i) is a scalar and there's no point in wrapping that in [].
- I don't understand why you've got a for loop wrapped in a while loop.
Comparte un enlace a este comentario
Más respuestas (0)
Categorías
Más información sobre Data Type Identification en Centro de ayuda y File Exchange.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
