I need to find the the value of one variable against the other How can I do that ?
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Muhammad Qaisar Fahim
 el 27 de Nov. de 2021
  
    
    
    
    
    Editada: the cyclist
      
      
 el 27 de Nov. de 2021
            My a variable can take the value A=9075.5 if B=1 and  A=5464.8 if B=0. In my function I need to to find the values of A corresponding to the other values of B for example if my function for certain simulations chooses B=0.7 then my function should interpolate and find the corresponding value of A. How can I do that?
0 comentarios
Respuesta aceptada
  the cyclist
      
      
 el 27 de Nov. de 2021
        
      Editada: the cyclist
      
      
 el 27 de Nov. de 2021
  
      % Input data
A = [5464.8 9075.5];
B = [0 1];
% Some new value of B:
B_new = 0.7;
% Interpolate
A_new = interp1(B,A,B_new)
See the documentation I linked for more details on how to use this function.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Multirate Signal Processing 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!