Reformat data into B(H,σ) to H(B,σ)

1 回表示 (過去 30 日間)
sajan wahi
sajan wahi 2019 年 6 月 17 日
回答済み: sajan wahi 2019 年 6 月 28 日
I have data on Magnetic Induction B and Magnetostriction λ. Both depend on magnetic field H, and stress (σ) [B(H,σ), λ(H,σ)]. For solving magnetostriction problem using vector potential approach one needs to reformat data into B(H,σ) to H(B,σ) and λ(H,σ) to λ(B,σ). Can you please help me out how do I reformat data? Which function is useful in MATLAB?

採用された回答

sajan wahi
sajan wahi 2019 年 6 月 28 日
Figure out the way i could do with data using MATLAB interp1 command.
Here is the code attached. myfile.mat needed for this code is attached below. Hope that will help you all.
%% Code
clear all
clc
load('myFile.mat')
Bref = B(:,1)';
H=H';
% Lambda=Lambda';
for i = 1 : length(T)
H2(:,i) = interp1(B(:,i), H, Bref, 'pchip', 'extrap');
Lambda2(:,i) = interp1(B(:,i), Lambda(:,i), Bref, 'pchip', 'extrap');
end
B = Bref;
H = H2;
Lambda = Lambda2;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSeismology についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by