Error in fi divide for embedded fi object
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
For fi objects, B must be a scalar in A/B.
Error in / (line 23)
c = fidivide(a,b);
Respuesta aceptada
3 votos
Comparte un enlace a esta respuesta
15 comentarios
Comparte un enlace a este comentario
Comparte un enlace a este comentario
- Are you trying to do code generation? This error only occurs during code generation.
- You have defined the variable power to be floating-point double. Do you want the code to be purely fixed-point?
- Do you want to generate C code? or a MEX function to simulate in MATLAB?
Comparte un enlace a este comentario
Comparte un enlace a este comentario
- The range of the magnitude of the output is between
and
. This means that you need at least 30 integer bits, and 30 fractional bits in the output. The output is also positive and negative. To accomodate this, I chose a signed fixed-point type with a 64 bit word length and 32 bit fraction length. - You can see in the generated code that the large word length of the output means that multiple words of builtin C types were needed for intermediate products and sums.
- I changed the names of the variables from base, exp, power to b, e, p respectively so the builtin functions of the same name would not be overloaded.
- I separated out the functions that you want to generate code for from the test bench.
- The test bench compiles and runs fixed-point as a MATLAB Executable (MEX).
- The test bench also generates C code for the fixed-point function.
- Run MATLAB script test_bench to test and compile the code.
- Save each of the functions enclosed below in their own file.
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
- Debugging data for your reference
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Etiquetas
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)
