Asked by Wiley Mosley
on 30 Aug 2018

--Edited for clarity--

In Simulink you can create a constant block with a value of 3.14D2 which will lead to an output of 314.

In Matlab you can create a constant with a value of 3.14D2 which will also give an output of 314.

However, when you place a matlab function block in a simulink model and within that function you define a variable equal to 3.14D2 the resulting output is 3.14

Is there something I am needing to change to allow this function within a model to work correctly without manually changing the 3.14D2 to 3.14E2? Is there a setting to reinstate this functionality of utilizing Fortran notation in Matlab 2017b?

Summary: Functions originally in Fortran, recreated in matlab function blocks (2015a), attempting to update to 2017b. Lots of functions, lots of variables, was not originally written by me.

I would expect Matlab + Simulink to handle this gracefully, but it does not.

Answer by Wiley Mosley
on 13 Jun 2019

Accepted Answer

This was successfully addresed in a bug fix and update to 2019a.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 14 Comments

## dpb (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605075

## Star Strider (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605077

## Walter Roberson (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605090

## dpb (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605113

## Wiley Mosley (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605368

## James Tursa (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605380

## dpb (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605381

## Wiley Mosley (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605387

## dpb (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_605393

## dpb (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_606523

## Wiley Mosley (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_606532

## dpb (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_606536

## Wiley Mosley (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_606542

## dpb (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/416925-matlab-function-in-simulink-not-allowing-fortran-scientific-notation#comment_606588

Sign in to comment.