NONMEM 7.2 reads Matlab codes while processing structures printed by Matlab to csv - matlab

I need somebody familiar with both NONMEM 7.2 and Matlab R2013a to answer my question. I used the code published here: http://www.mathworks.com/matlabcentral/fileexchange/34889-struct2csv to make a datafile (a .csv file) for simulations in NONMEM. When NONMEM tries reading the .csv file, it ends up reading code of the file in Matlab. Why is this happening and what is the solution to this?
Additionally, if somebody has an alternative technique of writing structures to a .csv file, I would appreciate it. I'm sorry I cannot post the code because this is related to a research project in progress.
Regards,
Kumpal

Related

How to edit "mexopt.bat" file in Matlab?

I have Matlab R2014b and OpenCV 2.4, i have been trying to use ViolaJones Face Detection toolbox, but i have some troubles. I've searhced the problem and found a solution that suggest edit mexopt.bat file. What the real problem is here
The Matlab command
fullfile(prefdir, 'mexopts.bat')
returns
C:\Users\simit\AppData\Roaming\MathWorks\MATLAB\R2014b\mexopts.bat
but I can't find the file when I go to the path. How can I find the mexopts.bat file and edit it?
I have R2015b installed. I searched my computer for a mexopts.bat file, and found it in folders related to code I have from 2012-2013, but not in the new MATLAB install folder. For this reason I believe it's not a part of the standard MATLAB installation, which is probably why you didn't find it.
According to this thread it seems that the mexopts.bat file is no longer used in MATLAB starting R2014a, and instead you should look for these files:
mex_C_win32.xml
mex_C_win64.xml
MBUILD_C_win32.xml
MBUILD_C_win64.xml
If you are still convinced that you should find and edit a mexopts file, let me recommend you the Everything Search Engine to look for files on your hard-drive.

Cannot create .xlsx file in Octave 3.8.2

I have just switched from Matlab to Octave 3.8.2 and spending a lot of hours to rewrite my programs.
The issue I am currently having is related to io pkg's xlswrite function.
In the code I have implemented, my Matlab code would search a directory for an .xlsx file with a given name. If there was such a file, it would change the filename to filename_v2 and write data in it , else it would create it first and then write data in it.
However, Octave doesn't seem to work this way.
Actually, whenever I am trying to create a file using xlswrite function I get the following error:
error: xlsopen.m: file filename.xlsx not found
Any idea how I could go round this problem?
Thank you very much in advance.
Kostas
EDIT: I am using Windows 7 and the exact code is:
if exist('Data Logger.xlsx','file')==0
name='Data Logger.xlsx';
else
found=1;
v=1;
while found==1
v=v+1;
name_cand=strcat('Data Logger_v',num2str(v),'.xlsx');
if exist(name_cand,'file')==0
found=0;
end
end
name=name_cand;
end
xlswrite(name,Header)
Solved: Its seems that Octave does not accept spaces in filenames.
Changed Data Logger.xlsx to Data_Logger.xlsx and everything worked perfectly
Thank you all for your willingness to help.
Cheers, Kostas

Extract .mat data without matlab - tried scilab unsuccessfully

I've downloaded a data set that I am interested in. However, it is in .mat format and I do not have access to Matlab.
I've done some googling and it says I can open it in SciLab.
I tried a few things, but I haven't found any good tutorials on this.
I did
fd = matfile_open("file.mat")
matfile_listvar(fd)
and that prints out the filename without the extension. I tried
var1 = matfile_varreadnext(fd)
and that just gives me "var1 = "
I don't really know how the data is organized. The repository described the data it contains, but not how it is organized.
So, my question is, what am I doing wrong in extracting/viewing this data? I'm not committed to SciLab, if there is a better tool for this I am open to that.
One options is to use Octave, which can read .mat files and run most Matlab .m files. Octave is open source with binaries available for Linux, Mac, and Windows. Inside of Octave you can load the file using:
load file
See Octave's manual section 14.1.3 Simple File I/O for more details.
In Scilab:
loadmatfile('file.mat');
(Source)
I had this same interest a few years back. I used this question as a guide. It uses Python and SciPy. There are options for NumPy and hd5f as well. Another option is to write your own reader for the .mat format in whatever language you need. Here is the link to the mat file format definition.

Help importing .pdb file into Maple

I realy know nothing about Maple, so any help would be nice. I am attempting to import a .pdb file into Maple, as part of converting some Mathematica code to Maple. I need something that that can accomplish something equivalent to the Import command in Mathematica. I have tried using readdata, ImportData and fopen with little success. If anyone has any suggestions, that would be of great help.
There is no built-in reader for any of the different kinds of .pdb files in Maple.
Two suggestions:
Ask your question again on mapleprimes.
Import it in Mathematica and export it again as XML, which Maple can read.

Is there any way to read MATLAB's .mat files in Perl?

I have some data generated in MATLAB that I want to process using Perl. I saved the data from MATLAB in a .mat file. Is there any way to read it in Perl?
One option would be to save the binary MAT file as ASCII from inside MATLAB using something like:
load('test_data.mat');
save('test_data.asc', 'var1', 'var2', '-ascii');
Then you would have ASCII data to process in Perl.
If you need a solution completely written in Perl, then you should be able to automate the process using the Math::MATLAB package on CPAN.
NOTE: If Python is an option, you could use the loadmat function in the SciPy Python library.
The Java library JMatIO has worked well for me. Maybe you can try using inline Java.