Borrar filtros
Borrar filtros

How to define my N by 2 matrix of values to x and y

7 visualizaciones (últimos 30 días)
Robin Li
Robin Li el 29 de Abr. de 2019
Editada: Robin Li el 29 de Abr. de 2019
I have a N by 2 matrix Q consists of my column value of indepedent variables (N by 1 column vector) and dependent variables (N by 1 column vector), and I want to define my indepedent variables as x and dependent variables y, then I will be able to do my regression over two variables.
Or I was thinking maybe we don't have to define the variables. I have several matrices, and what codes should I write to let the program knows that I want to regress the second volumn over first volumn in that Q matrix? For example, p2=polyfit(Q(column1),Q(column2),2) to get the quadratic polynomial fitting?
How could I do that?
This is a simple question, but I just get started with MATLAB. Thank you for your helps!

Respuesta aceptada

KSSV
KSSV el 29 de Abr. de 2019
x = N(:,1) ;
y = N(:,2) ;

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by