void MainWindow::on_pushButton_clicked()
{
"S://MATLAB/",
"MATLAB Code files (*.m);;All Files (*.*)");
p->start("C:/\"Program Files\"/MATLAB/R2013a/bin/matlab.exe -nosplash -nojvm -r run('filename');");
}
void MainWindow::on_pushButton_clicked()
{
QString filename = QFileDialog::getOpenFileName(this, tr("Open"),
"S://MATLAB/",
"MATLAB Code files (*.m);;All Files (*.*)");
QProcess* p = new QProcess(this);
p->start("C:/\"Program Files\"/MATLAB/R2013a/bin/matlab.exe -nosplash -nojvm -r run('filename');");
}
To copy to clipboard, switch view to plain text mode
But I'm unable to use the string
filename to run MATLAB script file. Instead of sending the file path like "S:/MATLAB/test.m" , the variable name "filename" is being executed in the run command. I have to manually enter the file path. Is there any other way to redirect the file path to run it directly on a mouse-click.?
Bookmarks