Trying to find the function of x for 0<=x<=2L
Show older comments
clc; clear; close all; format short g;
%knowns
gamma = 1.4;
R = 8.31;
m = 4.0;
P0 = 10;
T0 = 300;
r0 = 0.01;
L = 0.05;
%function
x = [0:2*L];
func = @(x) r0((2*(x)/L)+ exp(-2*(x)/L));
y = func(x);
%graph
plot (x,y)
3 Comments
Adam
on 17 Feb 2020
What is your question?
fadams18
on 17 Feb 2020
can you post a snapshot of your function. what are all those values P0 and T0 for. i dont see where you have used them in the function
John D'Errico
on 17 Feb 2020
Rathr thn trying to use the colon operator to create x, as
x = [0:2*L];
you should learn to use linspace.
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!