gscatter plot with data from text file

5 visualizaciones (últimos 30 días)
Dana Kadosh
Dana Kadosh el 21 de Jun. de 2016
Hi, I'm trying to plot a gscatter plot with data from a text file. I used the import tool for Import Data from Multiple Text Files, and I got a dataArray with my data. Now I'm trying to draw a graph from the data. I got the data in cell class (the output), and I think that gscatter will suit. I want that the x axis will be my 5th column from the dataArray, and the y axis will be new data from another file (excel file) that I'll import, and I want to display the results on a scatter graph, organized by groups that are in my 3rd column in dataArray. for example, here is part of my 3rd column (class: cell) : [ 1] [ 1] [ 1] [ 1] [ 1] [ 2] [ 2] [ 2] [ 2] [ 2] [ 3] [ 3] [ 3] [ 3] [ 3] [ 4] [ 4] [ 4] [ 4] [ 4]
I tried this: figure(1) y=randn(55,1) %only for convenient example% gscatter(dataArray{5},y,dataArray{3})
and I got this error messages:
Error using grp2idx (line 83) A grouping variable must be a categorical, numeric, or logical vector, a cell vector of strings, or a 2D character array.
Error in mgrp2idx (line 32) [ogroup,gname] = grp2idx(group);
Error in gscatter (line 72) [g,gn,ignore1,ignore2,maxgrp] = mgrp2idx(g,size(x,1),','); %#ok<ASGLU>
Error in importfile1 (line 69) gscatter(dataArray{5},y,dataArray{3})
I thought that my data are grouping variable..
how can I deal with that problem?
Thank You, Dana

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by