View previous topic :: View next topic |
Author |
Message |
Code-Breaker
Joined: 30 Apr 2004 Posts: 12 Location: Tempe, AZ
|
Posted: Wed May 19, 2004 12:39 pm Post subject: DDE and arrays |
|
|
Hi,
I am creating plots using Matlab and DDE. Works like a charm.
I am using the XYXY command to pass data to be plotted. Matlab's extensive use of arrays and matrices makes me wonder. How hard would it be to have a command that would allow me to pass arrays of data, instead of X,Y pairs? Perhaps there is already a way of doing this, and I am overlooking it?
-C-B |
|
Back to top |
|
|
Code-Breaker
Joined: 30 Apr 2004 Posts: 12 Location: Tempe, AZ
|
Posted: Wed May 19, 2004 1:05 pm Post subject: |
|
|
Cancel that request. I forgot about the sprintf command in Matlab. |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Wed May 19, 2004 5:04 pm Post subject: |
|
|
It's been quite a while since I've sat in front of Matlab and I have no idea whether you can call functions in DLLs. If you can, then you'll be better off calling DPlot_Plot and/or DPlot_AddData. Really it all depends on how much data you're passing: if 1000 or so points or fewer then you won't notice much difference on the time, but for large data sets and/or if you're impatient, you'll save time passing arrays rather than converting to strings using sprintf - which DPlot must then convert back to numbers. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
Code-Breaker
Joined: 30 Apr 2004 Posts: 12 Location: Tempe, AZ
|
Posted: Thu May 27, 2004 4:14 pm Post subject: |
|
|
Hi David,
I have been doing some research on Matlab and external dlls. it can do it, but it needs a header file containing function prototypes to be able to load the library. I tried using 'dplot.h', which I found in the dplotjr\dplotlib\c directory, but it didn't work.
Any suggestions? Thanks. -Chris |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Thu May 27, 2004 4:24 pm Post subject: |
|
|
This page: http://www.codeproject.com/dll/MatlabGenericDll.asp implies that normal C header files will work. You may need to delete everything in dplot.h other than the function prototypes, I dunno.
The referenced article also explains how to call function in DLL's; if you weren't aware of this you might give it a try.
If this is no help at all let me know; maybe I can talk Santa Claus into an early Christmas and get Matlab. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
Code-Breaker
Joined: 30 Apr 2004 Posts: 12 Location: Tempe, AZ
|
Posted: Thu May 27, 2004 6:24 pm Post subject: |
|
|
Here's what I get in Matlab:
Quote: | >> loadlibrary('c:\work\dplotlib.dll','c:\work\dplot.h')
Warning: The data type 'error' used by function DPlot_Command does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_GetBitmap does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_GetBitmapEx does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_GetEnhMetaFile does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_Plot does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_PlotBitmap does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_PlotBitmap does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_PlotToRect does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_PlotToRect does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_Request does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_Request does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
Warning: The data type 'error' used by function DPlot_Start does not exist
(Type "warning off MATLAB:loadlibrary:typenotfound" to suppress this warning.)
>> |
An interesting thing to me is that several of the warnings are duplicates for the same functions, and some of the functions generated no warnings (eg., DPlot_Plot). I will continue to work at this. Thanks for your help. -Chris |
|
Back to top |
|
|
|