Borrar filtros
Borrar filtros

Interpolating data from the graph

16 visualizaciones (últimos 30 días)
subbu
subbu el 30 de Dic. de 2020
Comentada: subbu el 31 de Dic. de 2020
The graph shown is plotted ductility Vs Time period of a system for four diifferent Ry . What i needed is to find the Ry s for particular ductility demand ( say 2) for the time period varying from 0 to 20 as shown in the graph. The Ry s need to find out using interpolation of the given graphs ( ie, in between the four Ry s given). can someone help with this problem??
  2 comentarios
Cris LaPierre
Cris LaPierre el 30 de Dic. de 2020
Do you have the data that was used to create the figure?
subbu
subbu el 30 de Dic. de 2020

Iniciar sesión para comentar.

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 30 de Dic. de 2020
Ok, since you have all the data used to create the plot, you will just use the X and Y values as inputs to the interp1 function. For example, if I wanted to interpolate the values of each curve at T(s)=7, I would add the following to the bottom of your check.m script.
% interpolate at T(s) = 7
xq=7;
yq1 = interp1(Tn,meu1,xq);
yq2 = interp1(Tn,meu2,xq);
yq4 = interp1(Tn,meu4,xq);
yq8 = interp1(Tn,meu8,xq);
% visualize on the plot
plot(xq,yq1,'^')
plot(xq,yq2,'o')
plot(xq,yq4,'d')
plot(xq,yq8,'>')
  7 comentarios
Cris LaPierre
Cris LaPierre el 31 de Dic. de 2020
Editada: Cris LaPierre el 31 de Dic. de 2020
In that case, you need to interpolate twice. First to find the ductility values for all 4 known Ry lines, then again to guesstimate the Ry value of the actual point. I say guesstimate because this approach only works if you make some assumptions about Ry. Foremost is that Ry changes linearly.
% Use interpolation to estimate Ry line that passes through (4,2)
% interpolate at T(s) = 4
xq=4;
yq1 = interp1(Tn,meu1,xq)
yq2 = interp1(Tn,meu2,xq)
yq4 = interp1(Tn,meu4,xq)
yq8 = interp1(Tn,meu8,xq)
% Interpolate to find Ry line at ductility = 2
yq = 2;
Ryq = interp1([yq1 yq2 yq4 yq8],[1 2 4 8],yq)
Ryq =
1.8997
subbu
subbu el 31 de Dic. de 2020
yeah i think this willl do thanks for the help

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by