linux matlab 学习笔记(-)

本文介绍在Linux环境下使用Matlab的方法,包括启动选项如-nodesktop、-nodisplay等的含义及区别,如何添加工作目录,以及如何通过csvread命令读取CSV文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目前主要探讨matlab在linux下面的使用。

 

1.matalab的启动。

     matlab可以在命令行中进行计算,也可以启动GUI界面来操作。由于主要用于后台数据计算处理,主要探讨命令在termianl中操作。

matlab启动的一些选项:

-nodesktop   启动jvm(Jave Virtual Machine),不启动desktop, 但help 界面,preferences界面等仍可通过cmdline 调出,即jvm启动但不启动desktop,可以启动其他显示; 但是matlab不会在cmd history记录本次执行的命令

-nodisplay   启动jvm,不启动desktop,不启动任何显示相关,忽略任何DISPLAY 环境变量; 即jvm启动但不能显示

-nojvm       不启动jvm,则与之相关的一切活动将无法进行,包括图形界面显示,help 界面,preferences界面等 即jvm不启动故不能显示

-nosplash    只是不显示启动时的log画面,jvm,desktop等正常启动

2. 为matlab添加工作目录。
 在matlab命令行中输入:addpath  /yourdirecory
3.读csv文件。
csvread
Read comma-separated value file 
Syntax 
M = csvread(filename)
M = csvread(filename, row, col)
M = csvread(filename, row, col, range)
Description
M = csvread(filename) reads a comma-separated value formatted file, filename. The filename input is a string enclosed in single quotes. The result is returned in M. The file can only contain numeric values.
M = csvread(filename, row, col) reads data from the comma-separated value formatted file starting at the specified row and column. The row and column arguments are zero based, so that row=0 and col=0 specify the first value in the file.
M = csvread(filename, row, col, range) reads only the range specified. Specify range using the notation [R1 C1 R2 C2] where (R1,C1) is the upper left corner of the data to be read and (R2,C2) is the lower right corner. You can also specify the range using spreadsheet notation, as in range = 'A1..B7'.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值