How to print value in 3 column table

5 vues (au cours des 30 derniers jours)
Brian Espino
Brian Espino le 10 Juil 2019
Commenté : KSSV le 10 Juil 2019
I have a table with 3 columns and a lot of rows. Column 1 has x variable which is a whole real number, Column 2 has y var " " . I ask for input x and y, how can i print the third column? This is after having table on workspace lets call table 'table'
x= input('what is x val")
y=input('what is y val')
x = [table]
from here how do i find the specific value of x, y then print out the last value from the respective row?
Thanks in advance.
  1 commentaire
Brian Espino
Brian Espino le 10 Juil 2019
Ai= input('What is your A number? ');
Bi= input('What is your B number? ');
A= table(:,1);
B=table(:,2);
C=table(:,end);
F = scatteredInterpolant(A,B,C);
Ci=f(Zi,Ai);
fprintf(Ci)

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 10 Juil 2019
Read about scatteredInterpolant
n = 10 ;
x = rand(n,1) ; y = rand(n,1) ; z = rand(n,1) ;
F = scatteredInterpolant(x,y,z) ;
xi = rand ; yi = rand ;
zi = F(xi,yi)
  2 commentaires
Brian Espino
Brian Espino le 10 Juil 2019
Error using scatteredInterpolant
The input points must be a double array.
Error i get. can upload full code to give u idea
KSSV
KSSV le 10 Juil 2019
Your x,y,z might be single, convert them to double using double.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by