clcclear allclose allsyms x yzeta0 = 0.5L = 100;W = 100;h = 2;g = 0.0098;vt=sqrt(g*h)c=1v=c*vtt1 = L/vt = t1;T1 = zeta0*v*t/(2*L)*(1-cos(pi/50*x)).*(1-cos(pi/100*(y+150))) ; T2 = zeta0*v*t/L*(1-cos(pi/50*x)) ;T3 = zeta0*v*t/(2*L)*(1-cos(pi/50*x)).*(1-cos(pi/100*(y-150))) ; T = piecewise(0<=x<=100 , -150<=y<=-50, T1, 0<=x<=100 , -50<=y<=50, T2,0<=x<=100 , 50<=y<=150, T3) fplot(T)
MATLAB: How to write piecewise function in matlab for the following function. Please give me matlab code.
piecewise
Related Question
- How to plot
- How to plot this equation to obtain the figure
- Problem with simplify function used with matrices
- I need to write for loop: s=sin(pi/1)+cos(pi/2)+sin(pi/3)+….cos(pi/100)
- How to plot for this function
- How can we solve only for t1 variable in the equation P=R1 which has multiple variables such as t2 t3. Which is possible mathematically.
Best Answer