Plotting in Matlab: w vs z in (-1,1) Domain

  • Thread starter Thread starter lee403
  • Start date Start date
  • Tags Tags
    Matlab Plotting
Click For Summary
SUMMARY

The discussion focuses on plotting the relationship between variables w and z in MATLAB, defined by the equations w=cos(n*acos(z)) and z=cos(acos(w)/n) for n values of 1 through 4, over the domain (-1,1). The user explores different methods to visualize this relationship, including using arrays for z and plotting w as a dependent variable. The key insight is that overlaying the plots for different n values will illustrate the simultaneous validity of both equations within the specified domain.

PREREQUISITES
  • Understanding of MATLAB programming and plotting functions
  • Familiarity with trigonometric functions, specifically cosine and arccosine
  • Knowledge of recursive functions and their applications
  • Basic grasp of array manipulation in MATLAB
NEXT STEPS
  • Research MATLAB's array creation and manipulation techniques
  • Learn about plotting multiple datasets in MATLAB using the 'hold on' command
  • Explore the implications of recursive functions in mathematical modeling
  • Investigate the behavior of trigonometric functions over specified domains
USEFUL FOR

Students and educators in mathematics or engineering fields, MATLAB programmers, and anyone interested in visualizing mathematical relationships through programming.

lee403
Messages
16
Reaction score
1

Homework Statement


(In Matlab) The variables w and z are related by w=cos(n*acos(z)) and z=cos(acos(w)/n) for n = 1,2,3,4 plot w vs z over domain (-1,1).

Homework Equations


w=cos(n*acos(z))
z=cos(acos(w)/n)

The Attempt at a Solution


First I tried to substitute z into w and thought since I have a function which calls itself I'd use a recursive function but I don't have the initial conditions. Then I thought that since the domain is (-1,1) and z would be plotted on that axis I could make z equal to an array with endpoints -1 and 1 and then plug that array in for w. Then I'd simply plot(z, w). The coding part is not difficult it's just the thought process behind it.
 
Physics news on Phys.org
Normally, if you are asked to plot w vs. z over (-1, 1), you let one variable (say z) range from -1 to 1, and plot the other (w) as your dependent variable. In this case, I would try both ways.
Overlaying the two plots should show where both relations can be true at the same time.
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K