应用matlab实现数据分组。
Mostra commenti meno recenti
我下方的程序是想将H>=0时分成一组,H<0时分成一组。但是运行的时候报错,错误如图所示,应该如何改一下呢?
clc
clear all
clear all
%% 材料参数
mu0=4*pi*10^-7
%% 将数据导入matlab
data2=oommfodt2matlab('C:\ActiveTcl\oommf\nanocrystalline\Simulation(2.0)\minimize energy\直流磁化曲线\random_size_1T.odt')
b=data2.values(:,1)
m=data2.values(:,2)
%% 将横坐标B转换为H,将纵坐标m转换为B
H=0.001*b/mu0;
x=m./H; %求出磁化率
mur=x+1; %求出相对磁导率
mu=mur*mu0; %求出磁导率
%% 将H分段
m=length(H);
H1={};
H2={};
for i=1:m
if H(i)>=0
H1=H[H1{H(i)}]
else
H2=H[H1{H(i)}]
end
end

Risposta accettata
Più risposte (0)
Categorie
Scopri di più su 时频分析 in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!