How to Resolve a Plotting Error in Matlab?

Click For Summary
SUMMARY

The discussion centers on resolving a plotting error in MATLAB when generating y values from x data points using a custom function named marko. The user encounters an error on line 4 of the function, which is attributed to an undefined variable L. The correct implementation of the function requires clarification on the value of L and the complete code structure for successful execution.

PREREQUISITES
  • Familiarity with MATLAB programming and syntax
  • Understanding of function definitions in MATLAB
  • Knowledge of mathematical operations and expressions
  • Basic plotting techniques in MATLAB
NEXT STEPS
  • Define the variable L in the context of the marko function
  • Review MATLAB function syntax and error handling
  • Explore MATLAB plotting functions to visualize data
  • Investigate MATLAB debugging techniques to identify and resolve errors
USEFUL FOR

MATLAB users, data analysts, and students seeking to troubleshoot plotting errors and improve their coding skills in MATLAB.

solas99
Messages
69
Reaction score
1
HI,

i have a set of data that i want to plot with matlab, using an equation.
i have all x data points and want to generate y values for each x data point.

function y =marko(x)


y= (4.11/1.98)*{(1/4*((1-x/L).^2))-(1/4)-(x/L)};

x=(218+data points)

from the command window i have called:

y=marko(x);

i keep getting an error in marco (line4)

can someone help me figure out what i am doing wrong here.
 
Physics news on Phys.org
Can you post your complete code?

I'm unsure what your L is.

You might also have better luck posting this sort of thing in the homework help, or in the general computer science locations in the future.
 
Last edited:

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K