主要内容

Results for


Dedicated to all Flipbook contest lovers! :D
In just one week, we have about 200 amazing animations! We see many creative and compelling animations and more importantly a lot of FUN!
Now, let the voting begin! Vote on the animations you love. Also, share them with your friends, classmates, or colleagues. Show the world the beauty of mathematics!
Mini Hack Winners - Week 1
You probably can imagine how hard it is to pick the winners, given so many awesome entries there are! We came up with several categories:
Landscape:
Trees:
Illusion:
Cartoon:
MATropolis:
Geometry:
Congratulations to the winners! Each of you won your choice of a T-shirt, a hat, or a coffee mug. We will contact you after the contest ends.
Finally, we encourage all of you to share your experiences, thoughts, and feedback in our new contest discussions channel!
Josh
Josh
Last activity 2023-11-13

Loving all the animations I'm seeing so far and feeling so inspired and impressed by what y'all are sharing. Thanks for loading me up with new topics to learn about!
The Flipbook contest is currently in full swing! It's been truly inspiring to see the incredible artwork you've all created using MATLAB! Checkout the gallery page if you haven't already.
We have some exciting news for our contestants today! In order to allow for more complex and unique creations, we've increased the MATLAB Evaluation timeout limit from 55 to 235 seconds!! So, don't hold back! Feel free to throw in those extra intricate lines of code without worrying about timeouts.
To all those already participating, we commend your efforts and encourage you to keep pushing your boundaries. And remember, there's always room for more. So, why not invite your friends and fellow MATLAB enthusiasts to join in the fun?
See the latest addition to the contest from @Cleve Moler, the creator of MATLAB!
We also encourage everyone to engage in the contest discussions channel. Share your experiences, insights, and feedback about this contest. Your contributions enrich our community and help us improve future contests.
Looking forward to seeing more and more entries in coming weeks!
We reached the 100 animations milestone in less than 3 days! We are thrilled to see so many creative entries and talented members learning from each other.
Note that this contest is not just for experts. People with all skill levels can participate, improve their MATLAB skills, and have fun!
We have created new resources and tips for you to get started.
  1. Contest introductory video. The 3-minute video provides you with a quick introduction to how the contest works and how to create a simple animation.
  2. Animations blog post. The post demonstrates some coding techniques that can make your animations easier.
  3. AI Chat Playground. This is a new community app we just released. You can leverage the Generative AI tool to write initial draft MATLAB code or modify existing one.
  4. Get ideas from previous Mini Hack contests. There is a large gallery of amazing images, which provide you with ideas and code to start with.
  5. Remix is highly encouraged. Learning from others is the most effective way to learn. Make some SMALL changes and see what it would look like.
Check out our 100th animation by Tim. Isn't it amazing?
We look forward to seeing more of you joining us and having more fun!
Unlike last year's contest, there are some new technologies this year that might offer some advantages. Namely generative AI's like ChatGPT, Bard, etc. Not to be excluded, MathWorks just launched the AI Chat Playground :)
LAWAN HARUNA
LAWAN HARUNA
Last activity 2023-11-6

good afternoon everyone my name is Dundu lawan haruna ,i'm a final year student at the department of computer engineering ABU Zaria, Nigerian , and i wanted to do my final year project based on computer vision : project topic , designing an eye glasses to help those people with visual imparement to be able to navigate enviroment efficiently , that's why i need a support from you guys ,all advised are highly well come , thank you for your support.
The 2023 community contest - MATLAB Flipbook Mini Hack - starts today on Nov. 6th!
Participants across all skill levels are welcome to join! You can participate by creating a new animation or remixing an existing one with up to 2,000 characters of MATLAB code.
Contest Tips:
  1. Before you start, we highly recommend you check out the two examples - Bouncing and Spinning - to understand how the contest works.
  2. Share your thoughts, ask questions, or connect with others in our contest discussion channel.
Note that the first week (Nov. 6th, 2023, ~ Nov. 12th, 2023) is for creating entries only. Voting does not begin until the second week.
We look forward to seeing your creative work. Let the contest begin!
Recently, I came across a post about the JIT compiler on this Korean blog. In the post. The writer discussed the concept of the "Compile Threshold" and how it is calculated.
"The JVM accumulates the number of calls for each method called and compiles when the number exceeds a certain number. In other words, there is a standard for checking how often it is called and then deciding, 'It is time to compile.' This standard is called the compilation threshold. But what is this and why should it be used as a standard?"
The concept of the "Compile Threshold," as used above, seems to be more commonly associated with Tracing just-in-time compilation.
The writer used the simple Java code below to calculate the threshold.
for (int i = 0; i < 500; ++i) {
long startTime = System.nanoTime();
for (int j = 0; j < 1000; ++j) {
new Object();
}
long endTime = System.nanoTime();
System.out.printf("%d\t%d\n", i, endTime - startTime);
}
Since the MATLAB execution engine uses JIT compilation, I just wanted to perform the same experiment that the writer did.
I experimented using simple codes based on the code in the blog. I iterated a function 500 time using for-loop and calculated the execution time for each iteration using tic and toc. Then I plotted the execution time for each loop as blow. First five execution times are much higher than followings (10 times!) The test is very rough so I am not sure that I can conclude "MATLAB has Compile Threshold and it is 5!" but this value is actually correct ;-)
t0 = 0;
tfinal = 10;
y0 = [20;20];
timeToRun = zeros(500,1);
for i = 1:500
tStart = tic;
[preypeaks,predatorpeaks] = solvelotka(t0, tfinal, y0);
tEnd = toc(tStart);
timeToRun(i) = tEnd;
end
VS Code Extension for MATLAB was introduced back in April and has been downloaded 75K times since. Do people here use VS Code for writing MATLAB code?
Earlier this year a bunch of MATLAB users got together to talk about their hobbies in a lightning talk format.
  • Using "UIHTML" to create app components and Lightning
  • Creating generative art with MATLAB
  • Making MATLAB run on the Steam Deck (it was a wager)
Do you use MATLAB for hobbies?
Matt J
Matt J
Last activity 2023-10-15

Are there Matlab features which intend to satisfy your needs but fail in certain critical areas, forcing you to abandon them completely in favor of your own version or a 3rd party alternative? Perhaps these features are starting to improve with new Matlab releases, but not quickly enough? Share your own frustrations in the comments below.
Here are two of mine:
1. volumeViewier
volumeViewer is 6 years old now. It is fine when you only need to view one 3D image at a time, but I never do. In my work, I am putting several images side-by-side for visual comparison. For such work, you need to be able to programmatically change axis limits and grayscale and use linkprop to reflect these changes across all the images. With 2D image comparison, all that is possible, but volumeViewer supports none of those things. So, I resort to my own 3D viewer
2.Tomographic projection commands RADON and FANBEAM
These commands are provided in the Image Processing Toolbox seemingly for no other reason than to support homework exercises for people taking introductory tomographic imaging courses. They fail in a number of ways for people who need to do serious tomographic imaging work, producing artifacts or nonlinear effects which shouldn't be there. See for example Why isn't FANBEAM linear? or Radon Transform works unexpectedly. Moreover, the toolbox still provides tomographic projectors only for 2D imaging not 3D, even though 64-bit RAM has made volumetric imaging commonplace in Matlab for at least 10 years. Luckily, there are now freely available 3rd party alternatives like TIGRE.
goc3
goc3
Last activity 2023-11-6

Have you ever learned that something you were doing manually in MATLAB was already possible using a built-in feature? Have you ever written a function only to later realize (or be told) that a built-in function already did what you needed?
Two such moments come to mind for me.
1. Did you realize that you can set conditional breakpoints? Neither did I, until someone showed me that feature. To do that, open or create a file in the editor, right click on a line number for any line that contains code, and select Set Conditional Breakpoint... This will bring up a dialog wherein you can type any logical condition for which execution should be paused. Before I learned about this, I would manually insert if-statements during debugging. Then, after fixing each bug, I would have to delete those statements. This built-in feature is so much better.
2. Have you ever needed to plot horizontal or vertical lines in a plot? For the longest time, I would manually code such lines. Then, I learned about xline() and yline(). Not only is less code required, these lines automatically span the entire axes while zooming, panning, or adjusting axis limits!
Share your own Aha! moments below. This will help everyone learn about MATLAB functionality that may not be obvious or front and center.
(Note: While File Exchange contains many great contributions, the intent of this thread is to focus on built-in MATLAB functionality.)
Moja
Moja
Last activity 2023-10-13

The carot symbol on my keyboard (ˆ shift+6) doesn't work on matlab. Matlab doesn't recognize it so I can't write any equation with power symbol. I tried every possible solution on the web and it doesn't work. even in the character viewer I don't have any result when I search ''caret".
Exciting news for students! 🚀Simulink Student Challenge 2023 is live! Unleash your engineering skills and compete for exciting rewards. Submission deadline is December 12th, 2023!
Over the weekend I came across a pi approximation using durations of years and weeks (image below, Wolfram, eq. 89), accurate to 6 digits using the average Gregorian year (365.2425 days).
Here it is in MATLAB. I divided by 1 week at the end rather than multiplying by its reciprocal because you can’t divide a numeric by a duration in MATLAB (1/week).
weeks = @(n)n*days(7);
piApprox = ((years(13)-weeks(6))/years(13) + weeks(3)) / weeks(1)
% piApprox = 3.141593493469302
Here’s a breakdown
  • The first argument becomes 12.885 yrs / 13 yrs or 0.99115
  • Add three weeks: 0.99115 + 3 weeks = 21.991 days
  • The reduced fraction becomes 21.991 days / 7 days
Now it looks a lot closer to the more familiar approximation for pi 22/7 but with greater precision!
I'm curious how the community uses the hold command when creating charts and graphics in MATLAB. In short, hold on sets up the axes to add new objects to the axes while hold off sets up the axes to reset when new objects are added.
When you use hold on do you always follow up with hold off? What's your reasoning on this decision?
Can't wait to discuss this here! I'd love to hear from newbies and experts alike!
The way we've solved ODEs in MATLAB has been relatively unchanged at the user-level for decades. Indeed, I consider ode45 to be as iconic as backslash! There have been a few new solvers in recent years -- ode78 and ode89 for example -- and various things have gotten much faster but if you learned how to solve ODEs in MATLAB in 1997 then your knowledge is still applicable today.
In R2023b, there's a completely new framework for solving ODEs and I love it! You might argue that I'm contractually obliged to love it since I'm a MathWorker but I can assure you this is the real thing!
The new interface makes a lot of things a much easier to do. Its also setting us up for a future where we'll be able to do some very cool algorithmic stuff behind the scenes.
Let me know what you think of the new functionality and what you think MathWorks should be doing next in the area of ODEs.
Thats the task:
Given a square cell array:
x = {'01', '56'; '234', '789'};
return a single character array:
y = '0123456789'
I wrote a code that passes Test 1 and 2 and one that passes Test 3 but I'm searching a condition so that the code for Test 3 runs when the cell array only contains letters and the one for Test 1 and 2 in every other case. Can somebody help me?
This is my code:
y = []
[a,b]=size(x)
%%TEST 3
delimiter=zeros(1,a)
delimiter(end)=1
delimiter=repmat(delimiter,1,b)
delimiter(end)=''
delimiter=string(delimiter)
y=[]
for i=1:a*b
y = string([y x(i)])
end
y=join(y,delimiter)
y=erase(y,'0')
y=regexprep(y,'1',' ')
%%TEST 1+2
for i=1:a*b
y = string([y x(i)])
y=join(y)
end
y=erase(y,' ' )