Hi Alexey,
Thanks for your reply. Could you provide me with a specific code sample? I have a few questions:
1. the array that I have is a float array consisting decibal values from 0-96 DB scaled to 0-1 DB, the array is like (M,N) where M is the no of windows used and N is the total no of samples in each window
i am using C++ to call in Mathgl, so what headers needs to be included? I want to link that spectrogram(M,N) matrix as mglData which throws me error can you show me the correct way to do it? I do it as
spect[m][n]= certain values input
then
mglGraph gr;
mglData arr;
mglData x;//not using at the moment but would like to show x and y dimension
mglData y;//not using at the moment but would like to show x and y dimension
arr.Link(m_gl);
y.Link(ydat,num
gr->SetQuality(6);
gr.Alpha(true);
gr.Box();
gr.Dens(m_gl);
gr.Colorbar();
gr.WriteJPEG("/home/koyel/test.jpg");
delete gr;
errors:
error: no matching function for call to ‘mglData::Link(float [(((long unsigned int)(((long int)num_rows) + -0x00000000000000001)) + 1)][(((long unsigned int)(((long int)windowSize) + -0x00000000000000001)) + 1)], int&, int&)’
specto.cpp:181:34: note: candidates are:
/usr/local/include/mgl2/data.h:77:14: note: void mglData::Link(mreal*, long int, long int, long int)
/usr/local/include/mgl2/data.h:77:14: note: no known conversion for argument 1 from ‘float [(((long unsigned int)(((long int)num_rows) + -0x00000000000000001)) + 1)][(((long unsigned int)(((long int)windowSize) + -0x00000000000000001)) + 1)]’ to ‘mreal* {aka double*}’
/usr/local/include/mgl2/data.h:79:14: note: void mglData::Link(mglData&)
/usr/local/include/mgl2/data.h:79:14: note: candidate expects 1 argument, 3 provided
second error with dens function:
error: no matching function for call to ‘mglGraph::Dens(float [(((long unsigned int)(((long int)num_rows) + -0x00000000000000001)) + 1)][(((long unsigned int)(((long int)windowSize) + -0x00000000000000001)) + 1)])’
specto.cpp:188:13: note: candidates are:
/usr/local/include/mgl2/mgl.h:793:14: note: void mglGraph::Dens(const mglDataA&, const mglDataA&, const mglDataA&, const char*, const char*)
/usr/local/include/mgl2/mgl.h:793:14: note: candidate expects 5 arguments, 1 provided
/usr/local/include/mgl2/mgl.h:795:14: note: void mglGraph::Dens(const mglDataA&, const char*, const char*)
/usr/local/include/mgl2/mgl.h:795:14: note: no known conversion for argument 1 from ‘float [(((long unsigned int)(((long int)num_rows) + -0x00000000000000001)) + 1)][(((long unsigned int)(((long int)windowSize) + -0x00000000000000001)) + 1)]’ to ‘const mglDataA&’
specto.cpp:191:8: error: type ‘class mglGraph’ argument given to ‘delete’, expected pointer
Can you please help me? It would be great to get MathGL to work on my project!