How can Plot in Matlab by exported data in maple?

 Réponse acceptée

Walter Roberson
Walter Roberson le 17 Déc 2024

1 vote

data = load('ST1.txt');
core = reshape(data(:, 3),100,100).';
subplot(3,1,1)
surf(real(core),'edgecolor', 'none')
subplot(3,1,2)
surf(imag(core),'edgecolor', 'none')
subplot(3,1,3)
surf(abs(core),'edgecolor', 'none')

5 commentaires

salim
salim le 17 Déc 2024
Modifié(e) : salim le 17 Déc 2024
@Walter Roberson this is exactly i am want and is so good and this is show that are you expert becuase i didn't explain this about real&imag and abs(@) but you did all of them in one figure i want them seperatly becuase the function is not clear like that also i want two dimension if possible be like that
but your graph is like that
is not clear so much but in top graph is so clear with inset graph of 2-D with effect of noise it will be something emazing and different can you do that also i export data in maple matrix this time just for one plot if make a different please help for finishing the work if possible
or something like that for this data
data = load('ST1.txt');
core = reshape(data(:, 3),100,100).';
figure()
surf(real(core),'edgecolor', 'none')
xlabel('x'); ylabel('y'); zlabel('ST1'); title('real ST1');
figure()
surf(imag(core),'edgecolor', 'none')
xlabel('x'); ylabel('y'); zlabel('ST1'); title('imag ST1');
figure()
surf(abs(core),'edgecolor', 'none')
xlabel('x'); ylabel('y'); zlabel('ST1'); title('abs ST1');
@Walter Roberson I’ve been working on a MATLAB project for over a month, but I’m stuck on a problem with plotting. Despite seeking help from various experts, I haven’t found a solution. The current graph doesn’t convey sufficient detail or meet the standards for publication in a high-impact journal.
A friend helped me by writing some code, but I need further improvements and fixes to achieve a professional and detailed result. Since you seem skilled in MATLAB, I hope you can assist me in refining the plot to make it publication-ready.
% Parameters
n = 1;
A = 1; % Amplitude
B = 1; % Width parameter of soliton
v = 1; % Velocity of soliton
alpha = 1; % Nonlinearity parameter
beta = 0.1; % Dispersion parameter
gamma = 0.05; % Noise intensity for multiplicative noise
% Grid for xi and time
xi = linspace(-20, 20, 2000); % Spatial range in transformed coordinates
t = linspace(-20, 20, 2000); % Time range
dt = t(2) - t(1); % Time step
% Generate Wiener process (increments) for time
W = cumsum(sqrt(dt) * randn(size(t))); % Wiener process for each time step
W = gamma * W; % Scale Wiener process by gamma
% Define initial soliton profile (deterministic solution)
u_deterministic = abs(((tanh(0.192e3 ./ 0.35e2 .* t' + xi) - 0.1e1) .^ (0.1e1 ./ 0.4e1)) .* exp(i * (-0.3e1 .* xi - 0.8e1 * t' + (3 .* W' ))));
% Ensure u_deterministic has the correct dimensions (time x space)
if size(u_deterministic, 1) ~= length(t) || size(u_deterministic, 2) ~= length(xi)
error('Mismatch in dimensions of u_deterministic. Check calculations.');
end
% Initialize storage for the stochastic solution
u_stochastic = zeros(length(t), length(xi));
noise=zeros(size(u_stochastic));
% Time evolution
for n = 1:length(t)
% Apply the Wiener noise factor at time step n
noise_factor = 1 + W(n);
noise(n,:)=noise_factor;
% Update solution with multiplicative noise
u_stochastic(n, :) = u_deterministic(n, :) * noise_factor;
end
% Plot the 3D surface of the stochastic Kudryashov soliton
figure;
surfc(xi, t, u_deterministic, 'EdgeColor', 'none');
title('Deterministic (Wiener Process)');
xlabel('Transformed Space (\xi)');
ylabel('Time (t)');
zlabel('Amplitude (u)');
colormap jet;
figure
surfc(xi, t, noise, 'EdgeColor', 'none');
title('Multiplicative Noise (Wiener Process)');
xlabel('Transformed Space (\xi)');
ylabel('Time (t)');
zlabel('Amplitude (u)');
colormap jet;
figure
surfc(xi, t, u_stochastic, 'EdgeColor', 'none');
title('Stochastic (Wiener Process)');
xlabel('Transformed Space (\xi)');
ylabel('Time (t)');
zlabel('Amplitude (u)');
colormap jet;
figure
surfc(xi, t, u_stochastic, 'EdgeColor', 'none');
title('Stochastic (Wiener Process)');
xlabel('Transformed Space (\xi)');
ylabel('Time (t)');
zlabel('Amplitude (u)');
colormap jet;
xlim([0 20])
ylim([-5 1])
zlim([-1 2])
i solved this problem which contain stochastic but i don't have expreince in stochastic this is my first time i faced to such problem
Below is my solution. As you can see, the Wiener process appears in the PDE soliton solution. I’ve treated all variables as constants except for delta and w(t), where w(t) represents a random Wiener process. The key parameter is delta. When δ=0, there is no noise in the system, but as delta increases, the noise becomes more pronounced. My goal is to demonstrate how changes in delta affect the behavior of the function.
alos countour of graph must be like this which show all part of noise
Additionally, this is another paper that demonstrates the effect of delta and includes a 3D graph showing the same behavior that you referenced. That’s the entire concept I wanted to convey.
In the top picture, ϵ corresponds to δ in our function. As ϵ (or delta) increases, the noise also increases. I want to highlight this effect. If you have any questions, I’ll be here to answer them. Thank you for your valuable work!
Sorry, I do not know anything about publication-ready plots.
salim
salim le 20 Déc 2024

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by