Borrar filtros
Borrar filtros

How to add one more column in dataset

4 visualizaciones (últimos 30 días)
Reyasudin
Reyasudin el 10 de Jun. de 2013
Comentada: Boy el 12 de Abr. de 2016
Hello,
I have a topographic data for three locations in a dataset called all_topo_data(46 by 8). I want to add another column(annual evaporation) into the dataset from a 3 dataset called annual_evaporation_kl, annual_evaporation_manila and annual_evaporation_bangkok which all the dataset contains only 1 by 1 matrix. I wanted to add the data according to variable called location in the all_topo_data dataset.
So..There will be a new column in all_topo_data called annual evaporation which will contains annual evaporation value according to locations.
Thank you

Respuesta aceptada

Hugo
Hugo el 10 de Jun. de 2013
I might not have understood your question, so please let me know if this does not answer it.
Suppose that you have a dataset A of size m x n and between the column 0<i<n and the following column you want to insert a column j from another dataset B. To do that, you just need to do the following
Anew = [ A(:,1:i) B(:,j) A(:,i+1:n)];
Does this solve your problem?
Best regards
  4 comentarios
Reyasudin
Reyasudin el 10 de Jun. de 2013
Thank you, although it does not solve my problem directly. You answer gave me an idea to solve it. Appreciate very much..
Boy
Boy el 12 de Abr. de 2016
Hi Hugo, i tried X=[X; zeros(size(X,1),1)]; and i got the following error Error using dataset/vertcat (line 31) All input arguments must be datasets. Any insight on that? Thank You

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by