Borrar filtros
Borrar filtros

plotting cells from arrays

2 visualizaciones (últimos 30 días)
Kuang-Yu WANG
Kuang-Yu WANG el 27 de Jun. de 2018
Comentada: Stephen23 el 28 de Jun. de 2018
for k2 = 1:22
data2 = mean(cellfun(@(x) x(k2,4), thething))
plot(data2,'-')
end
this is my codes. thething is my arrays contain cells. After I run the scripts, the plot just show nothing on it. Please tell me what's wrong with my code?
  8 comentarios
Kuang-Yu WANG
Kuang-Yu WANG el 28 de Jun. de 2018
thething = 63×1 cell array
{ 26×7 double} { 42×7 double} { 28×7 double} { 22×7 double} { 29×7 double} { 26×7 double} { 35×7 double} { 25×7 double} { 35×7 double} { 23×7 double} { 41×7 double} { 22×7 double} { 28×7 double} { 31×7 double} { 30×7 double} { 40×7 double} { 33×7 double} { 32×7 double} { 33×7 double} { 85×7 double} { 49×7 double} { 86×7 double} { 56×7 double} { 70×7 double} { 59×7 double} { 42×7 double} { 65×7 double} { 50×7 double} { 76×7 double} { 44×7 double} { 54×7 double} { 62×7 double} { 82×7 double} { 55×7 double} { 45×7 double} { 66×7 double} { 74×7 double} { 80×7 double} { 47×7 double} { 59×7 double} { 69×7 double} { 45×7 double} {105×7 double} { 98×7 double} {109×7 double} {118×7 double} {102×7 double} { 74×7 double} { 63×7 double} { 77×7 double} {169×7 double} {181×7 double} {240×7 double} {212×7 double} {150×7 double} {243×7 double} {251×7 double} {281×7 double} {281×7 double} {269×7 double} {281×7 double} {281×7 double} {211×7 double}
Stephen23
Stephen23 el 28 de Jun. de 2018
@Kuang-Yu WANG: please upload your data in a .mat file by clicking the paperclip button.

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 27 de Jun. de 2018
figure
hold on
for k2 = 1:22
data2 = mean(cellfun(@(x) x(k2,4), thething))
plot(data2,'-')
end
  4 comentarios
Kuang-Yu WANG
Kuang-Yu WANG el 28 de Jun. de 2018
size(data2)
ans =
1 1
Kuang-Yu WANG
Kuang-Yu WANG el 28 de Jun. de 2018
it works after i use the brush to select the data in screen. however why can't I plot out a line but just many dots?

Iniciar sesión para comentar.

Categorías

Más información sobre Line Plots 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