Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8767297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:46:30+00:00 2026-06-13T16:46:30+00:00

Simulink has a module called Matlab Function, which allows you to create a custom

  • 0

Simulink has a module called “Matlab Function,” which allows you to create a custom function in a Simulink flow diagram.

I implemented a simple function in a Simulink Matlab Function module. My function contains a call to Matlab’s built-in rms(). When I run the Simulink model, I get the following error:

The function 'rms' not supported for standalone code generation

If I remove rms from my Matlab Function in the Simulink model, the error goes away and the model runs flawlessly.

Questions:

  • Is there a way to use Matlab’s rms in Simulink?
  • Are there many other native Matlab calls that can’t be used inside Simulink?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:46:31+00:00Added an answer on June 13, 2026 at 4:46 pm

    I just wanted to clarify and expand upon some points made in learnvst’s answer.

    Even if you are simply trying to simulate a model containing a MATLAB Function block and are not explicitly attempting to perform code generation, you will still get the not supported for standalone code generation error.

    As learnvst indicated, there are multiple restrictions on functions that can be used with code generation. However, if you just want to simulate your model, Simulink allows you to do this if you signify these “black-listed” functions as being extrinsic. This lets Simulink know that the functions will be used for simulation purposes only and won’t be part of code generation.

    In your particular case, add the following line of code somewhere before your call to rms:

    coder.extrinsic('rms');
    

    Declaring a function as extrinsic in a MATLAB Function is often useful even when you are performing code generation. For example, you may want to visualize your data using the plot command during simulation, but obviously would not need the plot command to be part of generated code.

    Refer to this doc for more info on declaring functions to be extrinsic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 embedded Matlab functions which I am using to create a Simulink
I am trying to make an s-function block in matlab simulink.Here is the mdlOutput
I'm trying to generate C code from a Matlab-Simulink simple model (eg.: sine wave
I am trying to create an s-function in Simulink using s-function builder that will
I have a simple model from simulink and I would like to generate code
I define an enumerated type in MATLAB classdef(Enumeration) Color < Simulink.IntEnumType enumeration RED(0), GREEN(1),
What exactly is MATLAB/Simulink? I've tried to understand it but have only gotten more
In my Simulink model are some embedded MATLAB functions. Is there a way to
I've built a Matlab/Simulink model that I'm using to simulate the performance of an
I am trying to understand the Simulink (continuous) transfer function. In the documentation for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.