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 6541143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:04:07+00:00 2026-05-25T11:04:07+00:00

In Matlab, I have a function: function [ Result ] = Calc_Result(A, B, C,

  • 0

In Matlab, I have a function:

function [ Result ] = Calc_Result(A, B, C, D)

How do I graph the output of this function, for values A=0.00 to A=1.00, in steps of 0.01? Variables B,C,D are constants.

If the function returns NaN at any point on the graph, I need some method handling this (Matlab shouldn’t fall over).

  • 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-05-25T11:04:07+00:00Added an answer on May 25, 2026 at 11:04 am

    As strictlyrude27 said, if your function can deal with vectorisation, you can just use

    x=0:0.01:1;
    y=Calc_Result(A, B, C, D);
    plot(x,y,'.-');
    

    If not, you can use arrayfun to avoid a loop:

    x=0:0.01:1;
    y=arrayfun(@(A) Calc_Result(A, B, C, D),x);
    plot(x,y,'.-');
    

    plot deals with NaNs gracefully by default (it doesn’t plot them and breaks the line it draws at every NaN).

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

Sidebar

Related Questions

Does Python or any of its modules have an equivalent of MATLAB's conv2 function?
I have discovered through trial and error that the MATLAB engine function is not
I have a MATLAB function that finds charateristic points in a sample. Unfortunatley it
I have a MATLAB class which contains a reference to a java object classdef
I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to
I have written a simple brainfuck interpreter in MATLAB script language. It is fed
I have a bunch of <5 matlab scripts. Is there a tool that can
A colleague and I have spent a few years developing a really cool Matlab
I need MatLab for 2D and 3D modeling. I have little experience in MatLab.
I have to implement a single layer neural network or perceptron.For this, I have

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.