メインコンテンツ

結果:


imad
imad
最後のアクティビティ: 約18時間 前

Simulink has been an essential tool for modeling and simulating dynamic systems in MATLAB. With the continuous advancements in AI, automation, and real-time simulation, I’m curious about what the future holds for Simulink.
What improvements or new features do you think Simulink will have in the coming years? Will AI-driven modeling, cloud-based simulation, or improved hardware integration shape the next generation of Simulink?
cui,xingxing
cui,xingxing
最後のアクティビティ: 2025 年 2 月 8 日 14:01

MATLAB FEX(MATLAB File Exchange) should support Markdown syntax for writing. In recent years, many open-source community documentation platforms, such as GitHub, have generally supported Markdown. MATLAB is also gradually improving its support for Markdown syntax. However, when directly uploading files to the MATLAB FEX community and preparing to write an overview, the outdated document format buttons are still present. Even when directly uploading a Markdown document, it cannot be rendered. We hope the community can support Markdown syntax!
BTW,I know that open-source Markdown writing on GitHub and linking to MATLAB FEX is feasible, but this is a workaround. It would be even better if direct native support were available.
I have already created a 8-DOF electric vehicle model in MATLAB and during the verification method, I noticed that the roll angle does not really align with the data from CarMaker. I would like to seek for the oppinion from this community on how to improve the graph that I have obtained. I have also attatched the parameters of this vehicle as well as the graph that I have obtained. The blue plots indicates the data from a real world based electric model from CarMaker and yellow is from the 8-DOF model in matlab.
these are the vehicle parameters
data.g = 9.81; % [m/s^2] acceleration of gravity
data.f_res = 1.1e-2; % [-] rolling friction parameter
data.k_res = 6.5e-7; % [s^2/m^2] rolling friction coefficient
data.rho = 1.205; % [kg/m^3] air density
data.area = 2.156; % [m^2] cross section
data.cx = 0.30; % [-] drag coefficient
data.mass = 2200.10; % [kg] total vehicle mass
data.Jx = 552.75; % [kg*m^2] roll-axis inertia
data.Jz = 3002.5; % [kg*m^2] yaw-axis inertia
data.Jw = 2; % [kg*m^2] spin-axis inertia of wheel
data.radius = 0.3401; % [m] wheel radius
% Reduced Pacejka tyre model data
data.tyre_par(1) = 82.8868; % Pacejka coeff.
data.tyre_par(2) = 1.2070; % Pacejka coeff.
data.tyre_par(3) = 1.1351; % Pacejka coeff.
data.tyre_par(4) = 14.4035; % Pacejka coeff.
data.tyre_par(5) = 1.1932; % Pacejka coeff.
data.tyre_par(6) = -0.0001; % Pacejka coeff.
data.tyre_par(7) = 2.1219; % Pacejka coeff.
% Pacejka 5.2 tyre model data
tyre = ImportTyreData('.', 'Tyre_VSM.tir');
tyre = rmfield(tyre, 'file');
data.tyre_par_full = tyre;
data.wbase_f = 1.4727; % [m] front wheelbase
data.wbase_r = 1.4553; % [m] rear wheelbase
data.wbase = data.wbase_f + data.wbase_r; % [m] wheelbase
data.track = 1.655; % [m] track
data.h_cg = 0.631; % [m] centre of gravity height from ground
data.h_roll = 0.091; % [m] roll centre height from ground
data.k_roll_f = 8.67e4; % [Nm] roll stiffness at front
data.k_roll_r = 7.80e4; % [Nm] roll stiffness at rear
data.c_roll_f = 1.2e6; % [Nm/s] roll damping at front
data.c_roll_r = 6e5; % [Nm/s] roll damping at rear
data.k_act_roll = 0.9; % [-] active anti-roll coefficient
data.em_curve = [ % electric motor torque-speed curve
0, 900, 1000, 1100, 1200, 1300 % [RPM]
1500, 1500, 1400, 1000, 500, 0 % [Nm]
];
data.torque_bk_lb = -5e3; % [Nm] minimum brake torque
I am very pleased to share my book, with coauthors Professor Richard Davis and Associate Professor Sam Toan, titled "Chemical Engineering Analysis and Optimization Using MATLAB" published by Wiley: https://www.wiley.com/en-us/Chemical+Engineering+Analysis+and+Optimization+Using+MATLAB-p-9781394205363
Also in The MathWorks Book Program:
Chemical Engineering Analysis and Optimization Using MATLAB® introduces cutting-edge, highly in-demand skills in computer-aided design and optimization. With a focus on chemical engineering analysis, the book uses the MATLAB platform to develop reader skills in programming, modeling, and more. It provides an overview of some of the most essential tools in modern engineering design.
Chemical Engineering Analysis and Optimization Using MATLAB® readers will also find:
  • Case studies for developing specific skills in MATLAB and beyond
  • Examples of code both within the text and on a companion website
  • End-of-chapter problems with an accompanying solutions manual for instructors
This textbook is ideal for advanced undergraduate and graduate students in chemical engineering and related disciplines, as well as professionals with backgrounds in engineering design.
You've probably heard about the DeepSeek AI models by now. Did you know you can run them on your own machine (assuming its powerful enough) and interact with them on MATLAB?
In my latest blog post, I install and run one of the smaller models and start playing with it using MATLAB.
Larger models wouldn't be any different to use assuming you have a big enough machine...and for the largest models you'll need a HUGE machine!
Even tiny models, like the 1.5 billion parameter one I demonstrate in the blog post, can be used to demonstrate and teach things about LLM-based technologies.
Have a play. Let me know what you think.
Brent
Brent
最後のアクティビティ: 2025 年 2 月 1 日 23:52

My following code works running Matlab 2024b for all test cases. However, 3 of 7 tests fail (#1, #4, & #5) the QWERTY Shift Encoder problem. Any ideas what I am missing?
Thanks in advance.
keyboardMap1 = {'qwertyuiop[;'; 'asdfghjkl;'; 'zxcvbnm,'};
keyboardMap2 = {'QWERTYUIOP{'; 'ASDFGHJKL:'; 'ZXCVBNM<'};
if length(s) == 0
se = s;
end
for i = 1:length(s)
if double(s(i)) >= 65 && s(i) <= 90
row = 1;
col = 1;
while ~strcmp(s(i), keyboardMap2{row}(col))
if col < length(keyboardMap2{row})
col = col + 1;
else
row = row + 1;
col = 1;
end
end
se(i) = keyboardMap2{row}(col + 1);
elseif double(s(i)) >= 97 && s(i) <= 122
row = 1;
col = 1;
while ~strcmp(s(i), keyboardMap1{row}(col))
if col < length(keyboardMap1{row})
col = col + 1;
else
row = row + 1;
col = 1;
end
end
se(i) = keyboardMap1{row}(col + 1);
else
se(i) = s(i);
end
% if ~(s(i) = 65 && s(i) <= 90) && ~(s(i) >= 97 && s(i) <= 122)
% se(i) = s(i);
% end
end
Gowtham
Gowtham
最後のアクティビティ: 2025 年 1 月 29 日 15:56

My intention is to generate th code as mentioned below
void computeArea() {
rectangle.area = rectangle.length * rectangle.width;
}
Bunyamin
Bunyamin
最後のアクティビティ: 2025 年 1 月 29 日 13:33

ı m tryna prepare a battery simulation with simulink but when ı push right click on "battery-table based" , and then ı go simscape button, and ı just only see "log simulation data" . Have you any reccomend for this problem? It s probably an easy solution, but ı can't
Hasnat Mosharraf
Hasnat Mosharraf
最後のアクティビティ: 2025 年 1 月 26 日 23:50

This is the question I am trying to solve and I also uploading the code i have written and error I am getting, Please help me the error please.
Currently, according to the official documentation, "DisplayName" only supports character vectors or single scalar string as input. For example, when plotting three variables simultaneously, if I use a single scalar string as input, the legend labels will all be the same. To have different labels, I need to specify them separately using the legend function with label1, label2, label3.
Here's an example illustrating the issue:
x = (1:10)';
y1 = x;
y2 = x.^2;
y3 = x.^3;
% Plotting with a string scalar for DisplayName
figure;
plot(x, [y1,y2,y3], DisplayName="y = x");
legend;
% To have different labels, I need to use the legend function separately
figure;
plot(x, [y1,y2,y3], DisplayName=["y = x","y = x^2","y=x^3"]);
Error using plot
Value must be a character vector or a string scalar.
% legend("y = x","y = x^2","y=x^3");
Alessandro
Alessandro
最後のアクティビティ: 2025 年 1 月 25 日 19:47

Hi!

I’m facing a problem in which I need an “intermediate” level of detail for my simulation.

In my case, I’d like to simulate a radar altimeter flying at low altitude over some terrain or sea. Over this surface, suppose to have an obstacle (tree/house/ship/…). I know everything about my altimeter (pulsed radar, frenquency, pulse duration, beam width, …). A possible outcome of such a simulation could be the assessment of the impact of different gain patterns on the received pulse.

What I have always found on the internet are either too simple solution (like solving the radar equations) or too complex (Method of Moments, or similar approaches).

Regarding the radar equation, I have always wandered how it can deal with the echoes coming from the outer regions of the beamwidth of the altimeter antenna (the equation only has the boresight gain as input parameter).

On the other hand, in my opinion, approaches like MoM are really too complicated and beyond my scope.

I had a look and tried to implement some of the Matlab functions that already exist (e.g., the ones on the FMCW Radar Altimeter Simulation example), but I don’t think they meet my needs.

So I decided to try to write my own code, providing the shape of the terrain/sea surface, the shape for the obstacles (for now, just simple shapes)… I guess I’d have to sample the domain, evaluating the echoes for all these elements… however, even in this case there are a lot of parameters that I don’t know how to handle properly, for example: - is it reasonable to discretize terrain or sea instead of assuming some model for the backscatter? - how should the domain be discretized? - how can I guarantee the conservation of power, considering the effects of the radiation pattern of the antenna and the aforementioned discretization of the domain?

Thanks in advance for your support.

Best regards, Alessandro

Toshiaki Takeuchi
Toshiaki Takeuchi
最後のアクティビティ: 2025 年 2 月 3 日 14:35

私の場合、前の会社が音楽認識アプリの会社で、アルゴリズム開発でFFTが使われていたことがきっかけでした。でも、MATLABのすごさが分かったのは、機械学習のオンライン講座で、Andrew Ngが、線型代数を使うと、数式と非常に近い構文のコードで問題が処理できることを学んだ時でした。
Adam Danz
Adam Danz
最後のアクティビティ: 2025 年 1 月 29 日 8:11

Three former MathWorks employees, Steve Wilcockson, David Bergstein, and Gareth Thomas, joined the ArrayCast pod cast to discuss their work on array based languages. At the end of the episode, Steve says,
> It's a little known fact about MATLAB. There's this thing, Gareth has talked about the community. One of the things MATLAB did very, very early was built the MATLAB community, the so-called MATLAB File Exchange, which came about in the early 2000s. And it was where people would share code sets, M files, et cetera. This was long before GitHub came around. This was well ahead of its time. And I think there are other places too, where MATLAB has delivered cultural benefits over and above the kind of core programming and mathematical capabilities too. So, you know, MATLAB Central, File Exchange, very much saw the future.
Gabriel
Gabriel
最後のアクティビティ: 2025 年 1 月 22 日 16:23

Dears,
I am running a MS-DSGE model using RISE toolbox. I want to add a fiscal shock and examine its effect on output, price...
%fiscal shock
shock_type = {'eps_G'};
%here is my variable list of a cell array of character variables and not a struct.
var_list={'log_y','C','pi_ann','B_nominal','B','sp','i_ann','r_real_ann','P'};
% EXOGENOUS SWITCHING
myirfs1=irf(m1,'irf_periods',24,'irf_shock_sign',1);
% following the suggestion by @VBBV, I use the following sintaxes to access elements of struct
myirfs1 = struct()
myirfs1.eps_CP = struct();
myirfs1.eps_G = struct();
myirfs1.eps_T = struct();
myirfs1.eps_a = struct();
myirfs1.eps_nu = struct();
myirfs1.eps_z = struct();
var_aux = {'log_y','C','pi_ann','B_nominal','B','sp','i_ann','r_real_ann','P'};
var_aux3 = {'eps_G_log_y','eps_G_C','eps_G_pi_ann','eps_G_B_nominal','eps_G_B','eps_G_sp','eps_G_i_ann','eps_G_r_real_ann','eps_G_P'};
fieldnames(myirfs1)
myirfs1.eps_G.var = var_aux3 % assign the data array to the struct variable
irf_fisc = struct();
for i = 1:numel(var_aux)
irf_fisc.var_aux{i} = [0,myirfs1.eps_G.var{i}]';
end
irf_fisc.var_aux(1)
irf_fisc
% what is the write syntax to assign value (simulated data) to the struct?
myirfs1.eps_G.logy = data(:,1)/10; %Is the suggested code. but where is the data variable located? should I create it data = randn(TMax, N); or it is already simulated?
Gabriel
Gabriel
最後のアクティビティ: 2025 年 1 月 19 日 23:21

Dears,
I need your help. hocan I access the subfields within eps_G, where eps_G is a structure.
whos myirfs1
Name Size Bytes Class Attributes
myirfs1 1x1 374094 struct
%% disp(fieldnames(myirfs1))
>> disp(fieldnames(myirfs1))
{'eps_CP'}
{'eps_G' }
{'eps_T' }
{'eps_a' }
{'eps_nu'}
{'eps_z' }
% choose 1 or 2 below
shock_type = {'eps_G','eps_nu'};
var_aux = {'log_y','C','pi_ann','B_nominal','B','sp','i_ann','r_real_ann','P'};
var_aux2 = {'log_y_eps_nu','C_eps_nu','pi_ann_eps_nu','B_nominal_eps_nu','B_eps_nu','sp_eps_nu','i_ann_eps_nu','r_real_ann_eps_nu','P_eps_nu'};
var_aux3 = {'eps_G_log_y','eps_G_C','eps_G_pi_ann','eps_G_B_nominal','eps_G_B','eps_G_sp','eps_G_i_ann','eps_G_r_real_ann','eps_G_P'};
%Irfs of monetary and fiscal policy
irf_mon = struct();
irf_fisc = struct();
%% disp(fieldnames(myirfs1))
>> disp(fieldnames(myirfs1))
{'eps_CP'}
{'eps_G' }
{'eps_T' }
{'eps_a' }
{'eps_nu'}
{'eps_z' }
% when i run the following code it is unrecognized. can you suggest me what to do?
for i = 1:numel(var_aux)
irf_mon.(var_aux{i}) = [0,myirfs1(1).(var_aux3{i})]';
irf_fisc.(var_aux{i}) = [0,myirfs1(1).(var_aux3{i})]';
end
Unrecognized field name "log_y_eps_G".
Walter Roberson
Walter Roberson
最後のアクティビティ: 2025 年 2 月 10 日 1:51

This topic is for discussing highlights to the current R2025a Pre-release.
So you've downloaded the R2025a pre-release, tried Dark mode and are wondering what else is new. A lot! A lot is new!
One thing I am particularly happy about is the fact that Apple Accelerate is now the default BLAS on Apple Silicon machines. Check it out by doing
>> version -blas
ans =
'Apple Accelerate BLAS (ILP64)'
If you compare this to R2024b that is using OpenBLAS you'll see some dramatic speed-ups in some areas. For example, I saw up to 3.7x speed-up for matrix-matrix multiplication on my M2 Mabook Pro and 2x faster LU factorisation.
Details regarding my experiments are in this blog post Life in the fast lane: Making MATLAB even faster on Apple Silicon with Apple Accelerate » The MATLAB Blog - MATLAB & Simulink . Back then you had to to some trickery to switch to Apple Accelerate, now its the default.
Steve Eddins
Steve Eddins
最後のアクティビティ: 2025 年 1 月 20 日 11:58

I just published a blog post called "The Story of TIMEIT." I've been thinking about writing something like this ever since Mike Croucher's tic/toc blog post last spring.
There were a lot of opinions about TIMEIT expressed in the comments of that blog post, including some of mine.
My blog post today gives a more full history of the function, its design goals, and how it works. I thought it might prompt more discussion, so I'm creating this thread as a place for it.
If you are an interested user of TIMEIT, feel free to weigh in here with your thoughts. Perhaps the thread will influence MathWorks regarding what to do with TIMEIT, or with related performance measurement capabilities.
Frank
Frank
最後のアクティビティ: 2025 年 2 月 1 日 21:29

Hi
If you have used the playground and are familiar with its capabilities, I will be very interested in your opinion about the tool.
Thank you in advance for your reply/opinion.
At
Fortunate
Fortunate
最後のアクティビティ: 2025 年 1 月 15 日 13:39

I am trying to run a scipt I from File Exchange, but I am getting error "Error using fsolve (line 186) FSOLVE requires at least two input arguments" Can please help fix the error?
% Prepare the options for the solver
options = prepareOptionsForSolver(options, 'fsolve');
end
if nargin == 0
error(message('optim:fsolve:NotEnoughInputs')) (line 186)