メインコンテンツ

結果:

Álvaro Rey Antón
Álvaro Rey Antón
最後のアクティビティ: 2024 年 8 月 17 日

Hi,
I need to know how to resolve EDO System with MATLAB. The system has this structure:
A*x̄' + B*x̄ + C = 0
A, B are square matrix with constant coefficients. Example: A = [a b; c d]; and B = [e f; g h];
C is the constant vector transposed. Example: C = [i j]';
x̄ is the vector transposed of the variables/functions I need to find. Example: x̄ = [x1 x2]';
x̄' is the vector transposed of the derivative of the variables/functions I need to find. Example: x̄' = [dx1/dt dx2/dt]';
The example is made for a EDO System of 2 differential equations. But It would be interesting if MATLAB could resolve a n x n matrix.
Any suggestion?
Salam Surjit
Salam Surjit
最後のアクティビティ: 2024 年 11 月 3 日

Hi everyone, I am from India ..Suggest some drone for deploying code from Matlab.
Zahraa
Zahraa
最後のアクティビティ: 2024 年 9 月 9 日

Hello :-) I am interested in reading the book "The finite element method for solid and structural mechanics" online with somebody who is also interested in studying the finite element method particularly its mathematical aspect. I enjoy discussing the book instead of reading it alone. Please if you were interested email me at: student.z.k@hotmail.com Thank you!
Mohana priya
Mohana priya
最後のアクティビティ: 2024 年 8 月 10 日

Iam doing the project to find machining time for the cnc by creating a MATLAB Program ,I have G and M code in text file and the program should accept below points
  1. Read each line from the file.
  2. Extract the distance from G-code commands and the feedrate for each line.
  3. Calculate the time for each movement using the formula: time = distance / feedrate.
  4. Sum the times for all lines to get the total machining time.
Conditions:
G01 commands represent linear movements, so we calculate the distance directly.
G02 and G03 commands denote circular interpolation (clockwise and counterclockwise arcs, respectively). For these, compute the distance traveled along the arc.
For example, this below line is circular interpolation from G and M code Text file.
N1754 G03 X72.704 I10.704 J28.773 F2198.429
Could any one help me what formula should I use to get tool path for circular interpolation and linear interpolation to extract the distance.
Image Analyst
Image Analyst
最後のアクティビティ: 2025 年 4 月 4 日

Imagine that the earth is a perfect sphere with a radius of 6371000 meters and there is a rope tightly wrapped around the equator. With one line of MATLAB code determine how much the rope will be lifted above the surface if you cut it and insert a 1 meter segment of rope into it (and then expand the whole rope back into a circle again, of course).
Singh basne
Singh basne
最後のアクティビティ: 2024 年 8 月 9 日

Hello,
I am using BEAR TOOLBOX to obtain impulse response function of outcome variable to the 25 basis point monetary policy shock. The problem is there is no option in App of BEAR toolbox. how can i do it . please suggest
Luca Grillo
Luca Grillo
最後のアクティビティ: 2024 年 8 月 9 日

Hello everybody. I'm using Newton's method to solve a liner equation whose solution should be in [0 1]. Unfortunately, the coe I'm using gives NaN as a result for a specific combination of parameters and I would like to understand if I can improve the code I wrote for my Newton's method. In the specific case I'm considering, I reach the maximum iterations even if the tolerance is very low.
function [x,n,ier] = newton(f,fd,x0,nmax,tol)
% Newton's method for non-linear equations
ier = 0;
for n = 1:nmax
x = x0-f(x0)/fd(x0);
if abs(x-x0) <= tol
ier = 1;
break
end
x0 = x;
end
% % % % Script for solving NaN
mNAN= 16.1;
lNAN= 10^-4;
f= @(x) mNAN*x+lNAN*exp(mNAN*x)-lNAN*exp(mNAN);
Fd= @(x) mNAN*(1+lNAN*exp(mNAN*x));
tolNaN=10^-1;
nmax=10^8;
AB0 = 0.5;
[amNAN,nNAN,ierNAN]=newton(f,Fd,AB0,nmax,tolNaN);
amNAN
Llimit=f(0)
Ulimit=f(1)
fplot(@(x) mNAN*x+lNAN*exp(mNAN*x)-lNAN*exp(mNAN),[0 1.1])
David
David
最後のアクティビティ: 2025 年 5 月 8 日 17:28

A library of runnable PDEs. See the equations! Modify the parameters! Visualize the resulting system in your browser! Convenient, fast, and instructive.
Image Analyst
Image Analyst
最後のアクティビティ: 2024 年 9 月 9 日

Swimming, diving
16%
Other water-based sport
4%
Gymnastics
20%
Other indoor arena sport
15%
track, field
24%
Other outdoor sport
21%
346 票
David
David
最後のアクティビティ: 2024 年 8 月 14 日

Hello, MATLAB enthusiasts! 🌟
Over the past few weeks, our community has been buzzing with insightful questions, vibrant discussions, and innovative ideas. Whether you're a seasoned expert or a curious beginner, there's something here for everyone to learn and enjoy. Let's take a moment to highlight some of the standout contributions that have sparked interest and inspired many. Dive in and see how you can join the conversation or find solutions to your own challenges!

Interesting Questions

Oluwadamilola Oke is seeking assistance with a MATLAB code that works on version r2014b but encounters errors on version r2024a. The issue seems to be related to file location or the use of specific commands like movefile. If you have experience with these versions of MATLAB, your expertise could be invaluable.
Yohay has been working on a simulation to measure particle speed and fit it to the Maxwell-Boltzmann distribution. However, the fit isn't aligning perfectly with the data. Yohay has shared the code and histogram data for community members to review and provide suggestions.
Alessandro Livi is toggling between C++ for Arduino Pico and MATLAB App Designer. They suggest an enhancement where typing // for comments in MATLAB automatically converts to %. This small feature could improve the workflow for many users who switch between programming languages.

Popular Discussions

Athanasios Paraskevopoulos has started an engaging discussion on Gabriel's Horn, a shape with infinite surface area but finite volume. The conversation delves into the mathematical intricacies and integral calculations required to understand this paradoxical shape.
Honzik has brought up an interesting topic about custom fonts for MATLAB. While popular coding fonts handle characters like 0 and O well, they often fail to distinguish between different types of brackets. Honzik suggests that MathWorks could develop a custom font optimized for MATLAB syntax to reduce coding errors.

From the Blogs

Guy Rouleau addresses a common error in Simulink models: "Derivative of state '1' in block 'X/Y/Integrator' at time 0.55 is not finite." The blog post explores various tools and methods to diagnose and resolve this issue, making it a valuable read for anyone facing similar challenges.
Guest writer Gianluca Carnielli, featured by Adam Danz, shares insights on creating time-sensitive animations using MATLAB. The article covers controlling the motion of multiple animated objects, organizing data with timetables, and simplifying animations with the retime function. This is a must-read for anyone interested in scientific animations.
Feel free to check out these fascinating contributions and join the discussions! Your input and expertise can make a significant difference in our community.
Athanasios Paraskevopoulos
Athanasios Paraskevopoulos
最後のアクティビティ: 2025 年 5 月 8 日 17:28

Hi everyone,

I've recently joined a forest protection team in Greece, where we use drones for various tasks. This has sparked my interest in drone programming, and I'd like to learn more about it. Can anyone recommend any beginner-friendly courses or programs that teach drone programming?

I'm particularly interested in courses that focus on practical applications and might align with the work we do in forest protection. Any suggestions or guidance would be greatly appreciated!

Thank you!

I have picked the title but don't know which direction to take it. Looking for any and all inspiration. I took the project as it sounded interesting when reading into it, but I'm a satellite novice, and my degree is in electronics.
Muhammad
Muhammad
最後のアクティビティ: 2025 年 5 月 8 日 17:28

"What are your favorite features or functionalities in MATLAB, and how have they positively impacted your projects or research? Any tips or tricks to share?
function ans = your_fcn_name(n)
n;
j=sum(1:n);
a=zeros(1,j);
for i=1:n
a(1,((sum(1:(i-1))+1)):(sum(1:(i-1))+i))=i.*ones(1,i);
end
disp
Athanasios Paraskevopoulos
Athanasios Paraskevopoulos
最後のアクティビティ: 2024 年 7 月 25 日

Gabriel's horn is a shape with the paradoxical property that it has infinite surface area, but a finite volume.
Gabriel’s horn is formed by taking the graph of with the domain and rotating it in three dimensions about the axis.
There is a standard formula for calculating the volume of this shape, for a general function .Wwe will just state that the volume of the solid between a and b is:
The surface area of the solid is given by:
One other thing we need to consider is that we are trying to find the value of these integrals between 1 and . An integral with a limit of infinity is called an improper integral and we can't evaluate it simply by plugging the value infinity into the normal equation for a definite integral. Instead, we must first calculate the definite integral up to some finite limit b and then calculate the limit of the result as b tends to :
Volume
We can calculate the horn's volume using the volume integral above, so
The total volume of this infinitely long trumpet isπ.
Surface Area
To determine the surface area, we first need the function’s derivative:
Now plug it into the surface area formula and we have:
This is an improper integral and it's hard to evaluate, but since in our interval
So, we have :
Now,we evaluate this last integral
So the surface are is infinite.
% Define the function for Gabriel's Horn
gabriels_horn = @(x) 1 ./ x;
% Create a range of x values
x = linspace(1, 40, 4000); % Increase the number of points for better accuracy
y = gabriels_horn(x);
% Create the meshgrid
theta = linspace(0, 2 * pi, 6000); % Increase theta points for a smoother surface
[X, T] = meshgrid(x, theta);
Y = gabriels_horn(X) .* cos(T);
Z = gabriels_horn(X) .* sin(T);
% Plot the surface of Gabriel's Horn
figure('Position', [200, 100, 1200, 900]);
surf(X, Y, Z, 'EdgeColor', 'none', 'FaceAlpha', 0.9);
hold on;
% Plot the central axis
plot3(x, zeros(size(x)), zeros(size(x)), 'r', 'LineWidth', 2);
% Set labels
xlabel('x');
ylabel('y');
zlabel('z');
% Adjust colormap and axis properties
colormap('gray');
shading interp; % Smooth shading
% Adjust the view
view(3);
axis tight;
grid on;
% Add formulas as text annotations
dim1 = [0.4 0.7 0.3 0.2];
annotation('textbox',dim1,'String',{'$$V = \pi \int_{1}^{a} \left( \frac{1}{x} \right)^2 dx = \pi \left( 1 - \frac{1}{a} \right)$$', ...
'', ... % Add an empty line for larger gap
'$$\lim_{a \to \infty} V = \lim_{a \to \infty} \pi \left( 1 - \frac{1}{a} \right) = \pi$$'}, ...
'Interpreter','latex','FontSize',12, 'EdgeColor','none', 'FitBoxToText', 'on');
dim2 = [0.4 0.5 0.3 0.2];
annotation('textbox',dim2,'String',{'$$A = 2\pi \int_{1}^{a} \frac{1}{x} \sqrt{1 + \left( -\frac{1}{x^2} \right)^2} dx > 2\pi \int_{1}^{a} \frac{dx}{x} = 2\pi \ln(a)$$', ...
'', ... % Add an empty line for larger gap
'$$\lim_{a \to \infty} A \geq \lim_{a \to \infty} 2\pi \ln(a) = \infty$$'}, ...
'Interpreter','latex','FontSize',12, 'EdgeColor','none', 'FitBoxToText', 'on');
% Add Gabriel's Horn label
dim3 = [0.3 0.9 0.3 0.1];
annotation('textbox',dim3,'String','Gabriel''s Horn', ...
'Interpreter','latex','FontSize',14, 'EdgeColor','none', 'HorizontalAlignment', 'center');
hold off
daspect([3.5 1 1]) % daspect([x y z])
view(-27, 15)
lightangle(-50,0)
lighting('gouraud')
The properties of this figure were first studied by Italian physicist and mathematician Evangelista Torricelli in the 17th century.
Acknowledgment
I would like to express my sincere gratitude to all those who have supported and inspired me throughout this project.
First and foremost, I would like to thank the mathematician and my esteemed colleague, Stavros Tsalapatis, for inspiring me with the fascinating subject of Gabriel's Horn.
I am also deeply thankful to Mr. @Star Strider for his invaluable assistance in completing the final code.
References:
  1. How to Find the Volume and Surface Area of Gabriel's Horn
  2. Gabriel's Horn
  3. An Understanding of a Solid with Finite Volume and Infinite Surface Area.
  4. IMPROPER INTEGRALS: GABRIEL’S HORN
  5. Gabriel’s Horn and the Painter's Paradox in Perspective
When it comes to MOS tube burnout, it is usually because it is not working in the SOA workspace, and there is also a case where the MOS tube is overcurrent.
For example, the maximum allowable current of the PMOS transistor in this circuit is 50A, and the maximum current reaches 80+ at the moment when the MOS transistor is turned on, then the current is very large.
At this time, the PMOS is over-specified, and we can see on the SOA curve that it is not working in the SOA range, which will cause the PMOS to be damaged.
So what if you choose a higher current PMOS? Of course you can, but the cost will be higher.
We can choose to adjust the peripheral resistance or capacitor to make the PMOS turn on more slowly, so that the current can be lowered.
For example, when adjusting R1, R2, and the jumper capacitance between gs, when Cgs is adjusted to 1uF, The Ids are only 40A max, which is fine in terms of current, and meets the 80% derating.
(50 amps * 0.8 = 40 amps).
Next, let’s look at the power, from the SOA curve, the opening time of the MOS tube is about 1ms, and the maximum power at this time is 280W.
The normal thermal resistance of the chip is 50°C/W, and the maximum junction temperature can be 302°F.
Assuming the ambient temperature is 77°F, then the instantaneous power that 1ms can withstand is about 357W.
The actual power of PMOS here is 280W, which does not exceed the limit, which means that it works normally in the SOA area.
Therefore, when the current impact of the MOS transistor is large at the moment of turning, the Cgs capacitance can be adjusted appropriately to make the PMOS Working in the SOA area, you can avoid the problem of MOS corruption.
Marisa
Marisa
最後のアクティビティ: 2024 年 9 月 9 日

I am trying to earn my Intro to MATLAB badge in Cody, but I cannot click the Roll the Dice! problem. It simply is not letting me click it, therefore I cannot earn my badge. Does anyone know who I should contact or what to do?
I define the class in matlab as:
classdef Myclass
properties
Content
end
methods
function obj = Myclass(content)
obj.Content = content;
end
function disp(obj)
A = symmatrix('A(1/3,[0,0,1])');
disp(A);
end
end
end
When we run this class in live editor return 'A(1/3,[0,0,1])' rather than latex form.
Myclass(1)
% return 'A(1/3,[0,0,1])'
A = symmatrix('A(1/3,[0,0,1])');
% return latrx form A(1/3,[0,0,1])
Gregory Vernon
Gregory Vernon
最後のアクティビティ: 2024 年 11 月 22 日

Something that had bothered me ever since I became an FEA analyst (2012) was the apparent inability of the "camera" in Matlab's 3D plot to function like the "cameras" in CAD/CAE packages.
For instance, load the ForearmLink.stl model that ships with the PDE Toolbox in Matlab and ParaView and try rotating the model.
clear
close all
gm = importGeometry( "ForearmLink.stl" );
pdegplot(gm)
To provide talking points, here's a YouTube video I recorded.
Things to observe:
  1. Note that I cant seem to rotate continuously around the x-axis. It appears to only support rotations from [0, 360] as opposed to [-inf, inf]. So, for example, if I'm looking in the Y+ direction and rotate around X so that I'm looking at the Z- direction, and then want to look in the Y- direction, I can't simply keep rotating around the X axis... instead have to rotate 180 degrees around the Z axis and then around the X axis. I'm not aware of any data visualization applications (e.g., ParaView, VisIt, EnSight) or CAD/CAE tools with such an interaction.
  2. Note that at the 50 second mark, I set a view in ParaView: looking in the [X-, Y-, Z-] direction with Y+ up. Try as I might in Matlab, I'm unable to achieve that same view perspective.
Today I discovered that if one turns on the Camera Toolbar from the View menubar, then clicks the Orbit Camera icon, then the No Principal Axis icon:
That then it acts in the manner I've long desired. Oh, and also, for the interested, it is programmatically available: https://www.mathworks.com/help/matlab/ref/cameratoolbar.html
I might humbly propose this mode either be made more discoverable, similar to the little interaction widgets that pop up in figures:
Or maybe use the middle-mouse button to temporarily use this mode (a mouse setting in, e.g., Abaqus/CAE).
Hi everyone,
I need deep orientation to make calculation of speed and Angle for the absolute encoder RM22SC with signal (data+, Data-, Clock +, Clock -) using Launchpad F28379D and Simulink.
I did interface the absolute encoder with IC DS26LS32CN and I did get signal Data and Clock. I did use the GPIO20 for Data and GPIO21 for Clock and connect both to the Matlab Function block to get as output the position. See the code on attached. The output of the Matlab function times 2*pi/8192 to get the angle. However, I don't get anything as value.
Matlab Fuction Block code
function position = decodeSSI(data, clock)
%#codegen
persistent bitCounter shiftRegister prevClock
if isempty(bitCounter)
bitCounter = uint32(0);
shiftRegister = uint32(0);
prevClock = uint32(0);
end
% Parameters
numBits = 13; % Number of bits in the SSI word
% Rising edge detection for clock
clock = uint32(clock); % Ensure clock is of type integer
clockRisingEdge = (clock == 1) && (prevClock == 0);
prevClock = clock;
if clockRisingEdge
bitCounter = bitCounter + 1;
% Shift in the data bit
shiftRegister = bitor(bitshift(shiftRegister, 1), uint32(data));
% Check if we have received the full word
if bitCounter == numBits
position = shiftRegister;
% Reset for the next word
bitCounter = uint32(0);
shiftRegister = uint32(0);
else
position = uint32(0); % or NaN to indicate incomplete data
end
else
position = uint32(0); % or retain the last valid position
end
end