Main Content

Results for


I am processing ocean and climate data (1982-2022). Here, I have table which having heatwaves events details. Now, I want to sort the data month wise and also seasonal wise (summer:October- February, and winter:March-September), and then i wanted to plot mean seasonal and trend.
Sample file is attached. length of original file may vary in size.
Thanks in addvance.
Hello,
can someone help me with HEV model? I have no experience with simulink modeling, maybe someone have any simple HEV models or any tutorials how to start everything? :)
Thank you.
I am using simulink to generate a simple ADC sampling code. I configured ADC module in software mode, which updates the sampled value according to the sample time configured in the module. I set the sample time to 1e-4, 1e-5, 1e-6 respectively. But it seems that the sampling speed did not reach the value I set. I suspect it has something to do with the read and write operations, but I am not sure if that's the reason.
I also tried to do it using PWM event to trigger the start of conversion of ADC. Same problem happened. Because I connect a potentiometer and turn its knob slowly, the Graph on CCS is correct while when I turn it very quickly, the graph is not able to keep up with my movements. So the sampling rate is surely not enough. I wonder what I should do to successfully configure this model, thanks in advance!
Hello,
I have an Open Loop Transfer Function:
Gc(s)Gp(s) = aKp(1+Tis) / Tis(s+1+p)
It was decided for this system a=5, Ti=0.1 and p=0.5
What would the poles and zeroes be for this?
Ive done the other examples but this one looks very different to the other questions and it has me stuck.
Any help is appreciated and sorry if this is the wrong place to post such questions.
"The model is configured to create a SIL block, which is not supported for the selected hardware board. To resolve this, search for 'Create block' in the Configuration Parameters dialog box and set it to 'None' or 'PIL'.
I am facing an issue in data store memory block using store memory Read and write Block in matlab simulink. I have attached the screen short in which the posed error has been depicted.
Hello,
i want to implement a Energy Storage System with a Battery and a Supercapacitor, where the Supercapacitor comes in when the Battery has a short circuit for an emergency system. How can i implement something like this ? I think the right way is to implement a function where a switch is controlled by the SOC of the two storage systems or ?
Hi, I am currently studying the effects of varying switching frequency towards the inverter and motor system efficiency. I am using the three-phase converter which the gate signal is sent by a PWM generator. Inside the PWM generator block, there is switching frequency parameter. Therefore, is it possible if I can tune the value of switching frequency by making it as input and receving the signal in Matlab Simulink similar with Vabc and Vdc instead of tuning from Matlab code?
Hope to receive any comment or suggestion. Thank you.
Need some guidance on how to model the mutual inductance model from Simscape. The secondary side does not receive the voltage.
This is the 6th installment of the wish-list and bug report thread.
This topic is the follow on to the first Wish-list for MATLAB Answer sections and second MATLAB Answers Wish-list #2 (and bug reports). The third started out as New design of the forum - grey on white and the fourth and fifth also grew so large they are slow to load and navigate.
Same idea as the previous ones: one wish (or bug report) per answer, so that people can vote their wishes.
What should you post where?
Wishlist threads (#1 #2 #3 #4 #5 #6): bugs and feature requests for Matlab Answers
Frustation threads (#1 #2): frustations about usage and capabilities of Matlab itself
Missing feature threads (#1 #2): features that you whish Matlab would have had
Next Gen threads (#1): features that would break compatibility with previous versions, but would be nice to have
@anyone posting a new thread when the last one gets too large (about 50 answers seems a reasonable limit per thread), please update this list in all last threads. (if you don't have editing privileges, just post a comment asking someone to do the edit)
I want to understand this from the scratch, i will appreciate help and guidance very much.
Hi, having problems with this model. Tried changing all the capacitor values without any success. Any help/suggestions would be most welcome.
There are two kinds of text data type (=string data type) in MATLAB:
Text1='aText'; % first one
Text2="aText"; % first one
The second one did not exist in "old" MATLAB versions but the first one only.
My questions are: 1) What was motivation of MathWorks programmers to introduce the Text Data Type of the second format?
Yes, I know the difference: length(Text1)=5 whilst length(Text2)=1; Text1(2)='T' but Text2(2) does not exist. The array Text3=['one' ; 'fifth'] does not exist too.
2) However, any explanations and recommendations how to apply the second sort in contrast to the first one?
3) Is there any way how to convert one sort to another one?
Thanks for explanation in advance!
4 weeks of contests is fun but intense. Next, we recommend 3 things to do as warm-down exercises.
To make future contests better and more appealing to you, we created a 1-minute survey to understand your experience. Your feedback is critical to us!
2. Read 2022 Mini Hack Content Analysis blog post by Dave Bulkin
Dave Bulkin is a developer on the MATLAB Graphics and Charting Team. In the Blog post, @Dave B not only examines the code behind the leading entries, but also introduces you to some new visualization techniques.
Matt Tearle is from MathWorks Training Services Team. @Matt Tearle created this problem group to celebrate the 10th anniversary of Cody and the 2022 T20 World Cup (which happened to occur at the same time). Note that the problems can be done without the knowledge of cricket.
Thank you in advance and hope to see you in 2023!
The 2022 community contests have concluded! During the 4 weeks, we hope you had a lot of fun and learned some MATLAB skills. Together, we've achieved amazing milestones:
  • 500+ entries and 5,000+ votes created in the Mini Hack 2022 contest.
  • 100,000+ solutions submitted in Cody 10th Anniversary contest
  • 2,000+ participants in both contests
Now, it's time to announce weekly winners and grand prize winners!
Mini Hack - Pick of the MATLAB Graphics Team
We invited the MATLAB Graphics team, the authors of the MATLAB functions used in every entry, to be our Mini Hack judges. Here are their picks in 3 categories:
  • Our Top 3:
Rising Hand by Augusto Mazzei
Object used: fill; Judge comments: Clever code, nice metaphor, kind comments
Object used: patch (via VOXview); Judge comments: Very pretty, looks like it could be in a video game
Monocular rivalry by Jenny Bosten
Object used: Image; Judge comments: We spent a too much time trying to figure out what this illusion was doing to our brains
  • Clever use of Charts:
Object used: Bar3; Judge comments: Cute! Nice fireworks!
Ship by Shanshan Wang
Object used: histogram2; Judge comments: We didn't realize there was a ship in the flow data set
A fish for fun by Shanshan Wang
Object used: plot; Judge comments: Nifty and very different from other entries.
Colorful Fibonacci Spiral #3 by Basil Imoberdorf
Object used: scatter; Judge comments: Overlapping markers make for a very cool tunnel-like effect
  • Things we still loved:
Sandstone by Tim
Object used: image; Judge comments: Domain Warping FTW
Jellyfish by Tim
Object used: surface; Judge comments: Clever use of transparency
Congratulations and you should be very proud of yourself! It's a huge achievement that your entry is recognized by the MATLAB Graphics team!
Mini Hack - special category for Week 4
Our Week 4 special category is ‘Holiday’. The winner is Christmas snowman by Simon Thor
Mini Hack - grand prize winners
After an intensive (and very time-consuming) review of votes on winning entries, we have finalized the list of grand prize winners. Huge congratulations! We appreciate the time and effort you spent and the awesome entries you created. Each of you won an Amazon gift card.
Anton Kogios, Brandon Caasenbrood, KARUPPASAMYPANDIYAN M, Teodo, Jenny Bosten, MvLevi, Abdullah Caliskan, Stewart Thomas, Jonas Schlatter, and Tim Davis
Cody 10th Anniversary - surprise prize for 28-day streak winners
We are thrilled to see that 37 players have built a streak of 28 days! Coming back every day to solve problems is an incredible achievement. We decided to show our appreciation by awarding a surprise prize to those 37 players. Congratulations! Each of you will get a MathWorks T-shirt.
Christian Schröder, Stefan Abendroth, Mohammed, Victoria, Vasileios Pasialis, Gerardo Domínguez Ramírez, HH, Anton Kogios, Lizhi Zhu, Marco Fuscà, Armando Longobardi, Monica, Rithik KRT, Ayman, Teodo, Lincoln Poon, Elijah Keifert, siranjeevi gurumani, kazuyoshi kouno, Ryan Koh, Manuela Kaiser, Mehmet OZC, Dyuman Joshi, KOTHAPALLI SRI BRINDA, Gergely Patay, abyss, Takumi, Keita Abe, Petr Cerny, Shubham Shubham, Meredith, Andrew K, Atsushi Ueno, Peter Orthmann, Armando Longobardi, Chuang Tao, and David Romero
Cody 10th Anniversary winners – Week 4
The top 3 players for solving the most problems in week 4 are Christian Schröder, Gerardo Dominguez Ramirez, and Stefan Abendroth, Congratulations! Each of you won an Amazon gift card.
Week 4 lucky winners are Qingrui Liu and Basant Ale.
Cody 10th Anniversary winners – grand prize winners
We know how hard it is to be a top-10 leader in the contest leaderboard! It requires a huge time commitment and advanced MATLAB skills. Congratulations! Each of you will win an Amazon gift card.
Christian Schröder, Stefan Abendroth, Mohammed, Victoria, Vasileios Pasialis, Gerardo Domínguez Ramírez, HH, Anton Kogios, Lizhi Zhu, and Marco Fuscà
Lucky voters and participants
Thank you for your participation in our 2022 contests. You don’t need to be on the top of the leaderboards to win. As we announced, we would give out 20 MathWorks T-shirts to lucky voters and participants of the 2 contests.
Ismail Bera Altan, Robin Stolz, Michael Mellin, Kellan Smith, Neha Shaah, Siranjeevi gurumani, Paul Villain, Andrew Horchler, Meg Noah, Saurabh Chaudhary, Pakize erdogmus, Godfrey Ojerheghan, Selena Mastrodonato, Damir Rasic, Thomas Kjeldsen, Meredith, John Noah Ramiterre, Patience Oliveira, Panda, and Sujeet Kumar Choudhary
On behalf of the MATLAB Central community team, we thank you for joining our celebration of the MATLAB Central community 2022 contests. We hope you enjoyed these contests and look forward to seeing you in next year’s contests.
Hello,
I am trying to do image to image regression neural network training. In place of digitTrain4DArrayData, I have used my own dataset of 500 input and 500 output grayscale images of size 100*100 pixels for training.
The code is as follows:
imds1 = datastore(fullfile(matlabdrive,"T10itTI"),"IncludeSubFolders",true,...
"FileExtensions",".png","type","image");
imds2 = datastore(fullfile(matlabdrive,"TFiSTI"),"IncludeSubFolders",true,...
"FileExtensions",".png","type","image");
dsnew = combine(imds1,imds2);
layers = [
imageInputLayer([100 100 1])
batchNormalizationLayer
reluLayer('Name','relu_1')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_2')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_3')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_4')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_5')
convolution2dLayer(3,1,'Stride',2)
batchNormalizationLayer
reluLayer('Name','relu_6')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_7')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_8')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_9')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_10')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_11')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_12')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_13')
transposedConv2dLayer(1,1,'Stride',2)
batchNormalizationLayer
reluLayer('Name','relu_14')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_15')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_16')
convolution2dLayer(3,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_17')
convolution2dLayer(1,1,'Stride',1)
batchNormalizationLayer
reluLayer('Name','relu_18')
transposedConv2dLayer(3,1,'Stride',2)
fullyConnectedLayer(1)
regressionLayer
]
lgraph = layerGraph(layers);
options = trainingOptions("adam", ...
InitialLearnRate=8e-3, ...
SquaredGradientDecayFactor=0.99, ...
MaxEpochs=20, ...
MiniBatchSize=64, ...
Plots="training-progress")
net=trainNetwork(dsnew, lgraph, options);
On running the code, I get following error:
Error using trainNetwork Invalid training data. The output size ([1 1 1]) of the last layer does not match the response size ([1 1 1972224]).
When I use fullyConnectedLayer(1972224) in place of fullyConnectedLayer(1), I get following error:
Error using trainNetwork Layer 'fc': Invalid initializer. Requested 1972224x17161 (252.2GB) array exceeds maximum array size preference (5.0GB). This might cause MATLAB to become unresponsive.
Error in mt1tt1 (line 95) net=trainNetwork(dsnew, lgraph, options);
Caused by: Error using nnet.internal.cnn.assembler.InitializeMixin/initializeLearnableParameters Layer 'fc': Invalid initializer. Requested 1972224x17161 (252.2GB) array exceeds maximum array size preference (5.0GB). This might cause MATLAB to become unresponsive.
Can you suggest correction in code?
Thankyou
In Week 3, several new milestones have been achieved! Cody 10th contest has reached the 80,000-solution milestone! Mini Hack has over 400 entries. @Tim Davis’ seashell entry actually inspired a MathWorks blog post. Check it out.
During the last week of this contest, we strongly encourage you to inspire your colleagues, classmates, or friends to vote. Let the world know the beauty of Mathematics. Voters will also have the opportunity to win a MATLAB T-shirt.
MATLAB Mini Hack Winners - Week 3
In week 2, we announced the special category for week 3 is nature. Below are the 3 winners for this category.
Winners of other categories are:
Congratulations! Each of you won a T-shirt. I just heard we have 4 designs of MATLAB T-shirts. Can you collect all of them?
Cody 10th Anniversary Winners - Week 3
  • The top 3 players for solving the most problems in week 3 are Christian Schröder, Marco Fuscà, and Stefan Abendroth, Congratulations! Each of you won an Amazon gift card.
  • As long as you participate, you have the opportunity to win MathWorks T-shirts. Week 3 lucky winners are Luffy Wangand Augusto Mazzei.
What’s new in week 4?
MATLAB Mini Hack 2022:
  • Week 4’s new category is holiday! Halloween is around the corner. What holidays are you celebrating?
  • You are able to leverage Signal Processing Toolbox in your entry.
Cody 10th Anniversary:
Want a MATLAB T-shirt? We have 10 more to give out in the 10 days between now and Oct. 30th. You might win a MATLAB T-shirt by doing any of these activities:
  • Vote on entries you like from the Mini Hack contest
  • Solve Cody problems in the Cody 10th contest
  • Create or remix entries in the Mini Hack contest
The more activities you do, the higher your chance to win. Every day, we will pick a winner.
We had another wonderful week of community contests 2022. In week 2, the voting for Mini Hack started! About 1000 votes have been cast on 300+ entries. In Cody 10th Anniversary contest, we already have 85 finishers for the two special groups: Matrices and Arrays and Plotting and Visualization.
Now, it’s time to announce the weekly winners!
MATLAB Mini Hack Winners - Week 2
Amazing entries keep coming in every day. In week 2, we announced a space category to celebrate the milestone of NASA’s Dart mission. We’ve picked 4 winners for this new category.
Winners of other categories are:
Congratulations! Each of you won a MathWorks T-shirt. If this is the second time you won, you have the option to choose a MathWorks hat or a coffee mug!
Cody 10th Anniversary Winners - Week 2
  • The top 3 players for solving most problems in week 2 are Mohammed, Armando Longobardi, and Stefan Abendroth, Congratulations! Each of you won an Amazon gift card.
  • You don’t need to be an expert or spend tons of time to win! As long as you participate, you have the opportunity to win MathWorks T-shirts. Week 2 lucky winners are Dylan Baker and Takumi.
What’s new in week 3?
MATLAB Mini Hack 2022:
  • Week 3’s new category is nature! We look forward to seeing more nature-themed creative entries from you!
  • You are able to leverage up to 2 File Exchange submissions in your code.
Cody 10th Anniversary:
You might have read the news that NASA successfully crashed a spacecraft into an asteroid to alter the asteroid’s course. But did you know the spacecraft’s autonomous guidance system was developed in MATLAB and C++? Check out our latest blog post to learn more details.
Let’s celebrate this scientific milestone by creating astronomy-themed entries in the Mini Hack contest. Be creative and leverage the existing submissions in File Exchange. We will award special prizes to the best entries.