fixed and unfixed length strings

Character fields (fixed length)
Runtime: 1 microseconds
*data c1(200) type c.
*data c2(200) type c.
*data c3(400) type c.

c1 = 'mysap'.
c2 = '.com'.
concatenate c1 c2 into c3.


String (unfixed length)
Runtime: 0 microseconds

*data string1 type string.
*data string2 type string.
*data string3 type string.

string1 = 'mysap'.
string2 = '.com'.
concatenate string1 string2 into string3.

 

 

Documentation
Depending on the length of the character field,
string operation may be faster.
The concatenate algorithm has to compute the length of
the fixed character fields by scanning the first
non-blank character from the end.

 

% 清除之前的变量和图形窗口 clear; close all; % 读取数据 filename = 'C:\Users\sure\Documents\MATLAB\ActiveRecording.csv'; % 数据文件路径 % 从CSV文件中读取数据 data = csvread(filename, 2, 0); % 从第三行开始读取数据 % 提取分类数据 beforeData = data(:, [1 3 2]); % 交换Z轴和Y轴数据的顺序 noShearData = data(:, [4 6 5]); % 交换Z轴和Y轴数据的顺序 shearUnfixedData = data(:, [7 9 8]); % 交换Z轴和Y轴数据的顺序 shearFixedData = data(:, [10 12 11]); % 交换Z轴和Y轴数据的顺序 % 创建一个2行3列的图形窗口 figure; % 绘制before类别图形 subplot(2, 3, [2, 3]); plot(beforeData(:, 1), -beforeData(:, 2), 'r-'); axis square; % 设置轴为正方形 xlabel('X'); ylabel('Y'); % 将Y轴改为Z轴 title('Before'); grid on; % 绘制No Shear类别图形 subplot(2, 3, 4); plot(noShearData(:, 1), noShearData(:, 2), 'g-'); axis square; % 设置轴为正方形 xlabel('X'); ylabel('Y'); % 将Y轴改为Z轴 title('No Shear'); grid on; % 绘制Shear Unfixed类别图形 subplot(2, 3, 5); plot(shearUnfixedData(:, 1), shearUnfixedData(:, 2), 'b-'); axis square; % 设置轴为正方形 xlabel('X'); ylabel('Y'); % 将Y轴改为Z轴 title('Shear Unfixed'); grid on; % 绘制Shear Fixed类别图形 subplot(2, 3, 6); plot(shearFixedData(:, 1), shearFixedData(:, 2), 'm-'); axis square; % 设置轴为正方形 xlabel('X'); ylabel('Y'); % 将Y轴改为Z轴 title('Shear Fixed'); grid on; % 调整图形窗口大小和布局 set(gcf, 'Position', [100, 100, 1200, 800]);这个代码修改成使用boundary
最新发布
05-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值