Avoid "unnecessary data type conversion" warnings without switching of the respective diagnostics
1 次查看(过去 30 天)
显示 更早的评论
I have a low pass filter library block using the "Conversion Inherited" block to maintain fixed point scaling. In some cases the fixed point scaling of the incoming signal has no fraction (2^0 scaling) and so should be the output. Here the "Conversion Inherited" naturally has no effect and I get "Unnecessary type conversions" warnings. But even if it wasn't inside a library, that is used in many other places, I would like to keep the conversion block as it should grant me the right data type of the output with respect to the input signal, which IMHO is exactly what the "Conversion Inherited" block is made for. Is there any workaround allowing me to keep the diagnostics as well as the "Conversion Inherited" block without the wrong diagnostics with it?
TIA, Robert
1 个评论
John Harris
2017-12-13
I have the same question for "Data Type Conversion" blocks set to "Inherit: Inherit via back propagation." This is inside some Simulink library blocks (e.g. the Aerospace Blockset > Flight Parameters > Ideal Airspeed Correction > Mach <= 1.0 block). If my inputs to the Ideal Airspeed Correction block are Doubles, the type conversion is unnecessary and gets flagged. I wish we could at least disable the UnnecessaryDatatypeConvMsg diagnostic for library blocks....
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!