Hauptinhalt
Ergebnisse für
For Valentine's day this year I tried to do something a little more than just the usual 'Here's some MATLAB code that draws a picture of a heart' and focus on how to share MATLAB code. TL;DR, here's my advice
- Put the code on GitHub. (Allows people to access and collaborate on your code)
- Set up 'Open in MATLAB Online' in your GitHub repo (Allows people to easily run it)
I used code by @Zhaoxu Liu / slandarer and others to demonstrate. I think that those two steps are the most impactful in that they get you from zero to one but If I were to offer some more advice for research code it would be
3. Connect the GitHub repo to File Exchange (Allows MATLAB users to easily find it in-product).
4. Get a Digitial Object Identifier (DOI) using something like Zenodo. (Allows people to more easily cite your code)
There is still a lot more you can do of course but if everyone did this for any MATLAB code relating to a research paper, we'd be in a better place I think.
Here's the article: On love and research software: Sharing code with your Valentine » The MATLAB Blog - MATLAB & Simulink
What do you think?
Los invito a conocer el libro "Sistemas dinámicos en contexto: Modelación matemática, simulación, estimación y control con MATLAB", el cual estará disponible pronto en formato digital.
El libro integra diversos temas de los sistemas dinámicos desde un punto de vista práctico utilizando programas de MATLAB y simulaciones en Simulink y utilizando métodos numéricos (ver enlace). Existe mucho material en el blog del libro con posibilidades para comentarios, propuestas y correcciones. Resalto los casos de estudio
Creo que el libro les puede dar un buen panorama del área con la posibilidad de experimentar de manera interactiva con todo el material de MATLAB disponible en formato Live Script. Lo mejor es que se pueden formular preguntas en el blog y hacer propuestas al autor de ejercicios resueltos.
Son bienvenidos los comentarios, sugerencias y correcciones al texto.
I got thoroughly nerd-sniped by this xkcd, leading me to wonder if you can use MATLAB to figure out the dice roll for any given (rational) probability. Well, obviously you can. The question is how. Answer: lots of permutation calculations and convolutions.
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36850/image.png)
In the original xkcd, the situation described by the player has a probability of 2/9. Looking up the plot, row 2 column 9, shows that you need 16 or greater on (from the legend) 1d4+3d6, just as claimed.
If you missed the bit about convolutions, this is a super-neat trick
[v,c] = dicedist([4 6 6 6]);
bar(v,c)
% Probability distribution of dice given by d
function [vals,counts] = dicedist(d)
% d is a vector of number of sides
n = numel(d); % number of dice
% Use convolution to count the number of ways to get each roll value
counts = 1;
for k = 1:n
counts = conv(counts,ones(1,d(k)));
end
% Possible values range from n to sum(d)
maxtot = sum(d);
vals = n:maxtot;
end
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.
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
Overview
Authors:
- Narayanaswamy P.R. Iyer
- Provides Simulink models for various PWM techniques used for inverters
- Presents vector and direct torque control of inverter-fed AC drives and fuzzy logic control of converter-fed AC drives
- Includes examples, case studies, source codes of models, and model projects from all the chapters.
About this book
Successful development of power electronic converters and converter-fed electric drives involves system modeling, analyzing the output voltage, current, electromagnetic torque, and machine speed, and making necessary design changes before hardware implementation. Inverters and AC Drives: Control, Modeling, and Simulation Using Simulink offers readers Simulink models for single, multi-triangle carrier, selective harmonic elimination, and space vector PWM techniques for three-phase two-level, multi-level (including modular multi-level), Z-source, Quasi Z-source, switched inductor, switched capacitor and diode assisted extended boost inverters, six-step inverter-fed permanent magnet synchronous motor (PMSM), brushless DC motor (BLDCM) and induction motor (IM) drives, vector-controlled PMSM, IM drives, direct torque-controlled inverter-fed IM drives, and fuzzy logic controlled converter-fed AC drives with several examples and case studies. Appendices in the book include source codes for all relevant models, model projects, and answers to selected model projects from all chapters.
This textbook will be a valuable resource for upper-level undergraduate and graduate students in electrical and electronics engineering, power electronics, and AC drives. It is also a hands-on reference for practicing engineers and researchers in these areas.
I want to share a new book "Introduction to Digital Control - An Integrated Approach, Springer, 2024" available through https://link.springer.com/book/10.1007/978-3-031-66830-2.
This textbook presents an integrated approach to digital (discrete-time) control systems covering analysis, design, simulation, and real-time implementation through relevant hardware and software platforms. Topics related to discrete-time control systems include z-transform, inverse z-transform, sampling and reconstruction, open- and closed-loop system characteristics, steady-state accuracy for different system types and input functions, stability analysis in z-domain-Jury’s test, bilinear transformation from z- to w-domain, stability analysis in w-domain- Routh-Hurwitz criterion, root locus techniques in z-domain, frequency domain analysis in w-domain, control system specifications in time- and frequency- domains, design of controllers – PI, PD, PID, phase-lag, phase-lead, phase-lag-lead using time- and frequency-domain specifications, state-space methods- controllability and observability, pole placement controllers, design of observers (estimators) - full-order prediction, reduced-order, and current observers, system identification, optimal control- linear quadratic regulator (LQR), linear quadratic Gaussian (LQG) estimator (Kalman filter), implementation of controllers, and laboratory experiments for validation of analysis and design techniques on real laboratory scale hardware modules. Both single-input single-output (SISO) and multi-input multi-output (MIMO) systems are covered. Software platform of MATLAB/Simlink is used for analysis, design, and simulation and hardware/software platforms of National Instruments (NI)/LabVIEW are used for implementation and validation of analysis and design of digital control systems. Demonstrating the use of an integrated approach to cover interdisciplinary topics of digital control, emphasizing theoretical background, validation through analysis, simulation, and implementation in physical laboratory experiments, the book is ideal for students of engineering and applied science across in a range of concentrations.
I am excited to share my new book "Introduction to Mechatronics - An Integrated Approach, Springer, 2023" available through https://link.springer.com/book/10.1007/978-3-031-29320-7.
This textbook presents mechatronics through an integrated approach covering instrumentation, circuits and electronics, computer-based data acquisition and analysis, analog and digital signal processing, sensors, actuators, digital logic circuits, microcontroller programming and interfacing. The use of computer programming is emphasized throughout the text, and includes MATLAB for system modeling, simulation, and analysis; LabVIEW for data acquisition and signal processing; and C++ for Arduino-based microcontroller programming and interfacing. The book provides numerous examples along with appropriate program codes, for simulation and analysis, that are discussed in detail to illustrate the concepts covered in each section. The book also includes the illustration of theoretical concepts through the virtual simulation platform Tinkercad to provide students virtual lab experience.
I had originally planned on publishing my book via a traditional publisher, but am now reconsidering whether to use Amazon.com. I use Matlab and Latex in my book. It appears that it is not possible to publish is with Amazon due to this. Advice? Thanks. Kevin Passino
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36658/image.png)
Attaching the Photoshop file if you want to modify the caption.
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36639/image.png)
What better way to add a little holiday magic than the L-shaped membrane atop your evergreen? My colleagues output the shape and then added some thickness and an interior cylinder in Blender. Then, the shape was exported to STL and 3D printed (in several pieces). Then glued, sanded, primed, sanded again and painted. If you like, the STL file is attached. Thank you to https://blogs.mathworks.com/community/2013/06/20/paul-prints-the-l-shaped-membrane/ and a tip of the hat to MATLAB Ornament. Happy Holidays!
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36640/image.png)
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36641/image.jpeg)
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36566/image.jpeg)
I am very excited to share my new book "Data-driven method for dynamic systems" available through SIAM publishing: https://epubs.siam.org/doi/10.1137/1.9781611978162
This book brings together modern computational tools to provide an accurate understanding of dynamic data. The techniques build on pencil-and-paper mathematical techniques that go back decades and sometimes even centuries. The result is an introduction to state-of-the-art methods that complement, rather than replace, traditional analysis of time-dependent systems. One can find methods in this book that are not found in other books, as well as methods developed exclusively for the book itself. I also provide an example-driven exploration that is (hopefully) appealing to graduate students and researchers who are new to the subject.
Each and every example for the book can be reproduced using the code at this repo: https://github.com/jbramburger/DataDrivenDynSyst
Hope you like it!
Christmas season is underway at my house:
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36531/image.jpeg)
(Sorry - the ornament is not available at the MathWorks Merch Shop -- I made it with a 3-D printer.)
We are thrilled to announce the grand prize winners of our MATLAB Shorts Mini Hack contest! This year, we invited the MATLAB Graphics and Charting team, the authors of the MATLAB functions used in every entry, to be our judges. After careful consideration, they have selected the top three winners:
Judge comments: Realism & detailed comments; wowed us with Manta Ray
2nd place – Jenny Bosten
Judge comments: Topical hacks : Auroras & Wind turbine; beautiful landscapes & nightscapes
3rd place - Vasilis Bellos
Judge comments: Nice algorithms & extra comments; can’t go wrong with Pumpkins
Judge comments: Impressive spring & cubes!
In addition, after validating the votes, we are pleased to announce the top 10 participants on the leaderboard:
Congratulations to all! Your creativity and skills have inspired many of us to explore and learn new skills, and make this contest a big success!
Dear MATLAB contest enthusiasts,
Welcome to the third installment of our interview series with top contest participants! This time we had the pleasure of talking to our all-time rock star – @Jenny Bosten. Every one of her entries is a masterpiece, demonstrating a deep understanding of the relationship between mathematics and aesthetics. Even Cleve Moler, the original author of MATLAB, is impressed and wrote in his blog: "Her code for Time Lapse of Lake View to the West shows she is also a wizard of coordinate systems and color maps."
you to read it to learn more about Jenny’s journey, her creative process, and her favorite entries.
Question: Who would you like to see featured in our next interview? Let us know your thoughts in the comments!
My favorite image processing book is The Image Processing Handbook by John Russ. It shows a wide variety of examples of algorithms from a wide variety of image sources and techniques. It's light on math so it's easy to read. You can find both hardcover and eBooks on Amazon.com Image Processing Handbook
There is also a Book by Steve Eddins, former leader of the image processing team at Mathworks. Has MATLAB code with it. Digital Image Processing Using MATLAB
You might also want to look at the free online book http://szeliski.org/Book/
Over the past 4 weeks, 250+ creative short movies have been crafted. We had a lot of fun and, more importantly, learned new skills from each other! Now it’s time to announce week 4 winners.
Nature:
3D:
Seamless loop:
Holiday:
Fractal:
Congratulations! Each of you won your choice of a T-shirt, a hat, or a coffee mug. We will contact you after the contest ends.
Weekly Special Prizes
Thank you for sharing your tips & tricks with the community. These great technical articles will benefit community users for many years. You won a limited-edition pair of MATLAB Shorts!
![](https://www.mathworks.com/matlabcentral/discussions/uploaded_files/36411/image.png)
In week 5, let’s take a moment to sit back, explore all of the interesting entries, and cast your votes. Reflect what you have learned or which entries you like most. Share anything in our Discussions area! There is still time to win our limited-edition MATLAB Shorts.
I know we have all been in that all-too-common situation of needing to inefficiently identify prime numbers using only a regular expression... and now Matt Parker from Standup Maths helpfully released a YouTube video entitled "How on Earth does ^.?$|^(..+?)\1+$ produce primes?" in which he explains a simple regular expression (aka Halloween incantation) which matches composite numbers:
Here is my first attempt using MATLAB and Matt Parker's example values:
fnh = @(n) isempty(regexp(repelem('*',n),'^.?$|^(..+?)\1+$','emptymatch'));
fnh(13)
fnh(15)
fnh(101)
fnh(1000)
Feel free to try/modify the incantation yourself. Happy Halloween!