1 Star 2 Fork 3

Dean/PIDtoolbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
PTstr2num.m 894 Bytes
一键复制 编辑 原始数据 按行查看 历史
Brian White 提交于 2019-03-28 12:02 . Add files via upload
function data = PTstr2num(str, numCols)
%% data = PTstr2num(str, numCols)
% data = PTstr2num(str, numCols)
% modified from:
% https://www.mathworks.com/company/newsletters/articles/tips-for-accelerating-matlab-performance.html
% ----------------------------------------------------------------------------------
% "THE BEER-WARE LICENSE" (Revision 42):
% <brian.white@queensu.ca> wrote this file. As long as you retain this notice you
% can do whatever you want with this stuff. If we meet some day, and you think
% this stuff is worth it, you can buy me a beer in return. -Brian White
% ----------------------------------------------------------------------------------
% faster alternative to str2num
str = char(str);
str(:,end+1) = ' ';
data = sscanf(str','%f');
if nargin>1 && ~isempty(numCols)
data = reshape(data,numCols,[])';
end
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/IMdean/PIDtoolbox.git
git@gitee.com:IMdean/PIDtoolbox.git
IMdean
PIDtoolbox
PIDtoolbox
master

搜索帮助