Using linspace for dividing thicknesses and then adding them up

I am using linspace to break up a given thickness into different points. For example if thickness is 200 mm then linspace(0,200,500). So I ahve two materials of thickness 200 and 300 mm place on top of one another. I divide the first thickness into linspace (0,200,500) and the other thickness (0,300,500). But while plotting the results i need the array of distance to be linear eg from 0 to 500 mm and the calculations at each point. How do I get this?

댓글 수: 4

Can you give an example of what you are trying to plot. I'm not sure I understand the problem unless you mean that you want 500 data points to only reach as far as 200 in the 0-300 case also.
Ok.. So I have two thicknesses 200 and 300. I first divide the 200 thickness into data points linspace(0,200,550). I calculate the pressure at these points. For the next material i need to calculate the pressure also for that thickness hence linspace (0,300,500). So i have now the pressure results for 1000 data points. Now i need to plot these results against the total thickness which is (200+300= 500 mm) and 1000 data points. So the x axis should be from 0 to 500
You should just be able to concatenate your thickness arrays then e..g
thickness200 = linspace(0,200,500);
thickness300 = linspace(0,300,500);
totalThickness = [thickness200, thickness300];
Thanks but then the concatenated matrix would be {0....200 and then 0... 300]. I want it to be [0....200 and then 200.something....500]

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2017년 6월 13일
편집: KSSV 2017년 6월 13일
t1=linspace(0,200,500);
t2=linspace(200,500,500);
t12=[t1 t2];

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2017년 6월 13일

편집:

2017년 6월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by