Main Content

Results for


One community within MathWorks that has been helping students continue their learning is MATLAB Student Ambassadors. Despite new challenges with transitioning to distance learning, student ambassadors have done a truly amazing job. In a blog that was published recently, I discuss 3 examples of the great things that our student ambassadors have done to aid distance learning. Click here to read the blog. I hope after reading this blog you share my level of admiration for these students.

Student Ambassador at University of Houston hosting a fun and informative virtual event.

We are excited to announce that File Exchange now awards reputation points to the authors and you can view the points and rankings by week, month, year or all-time on the new leaderboard .
Reputation point is commonly used in many online communities to build trust and show appreciation to contributors. File Exchange rewards reputation points to authors who submit files, but it's definitely not easy to earn! You earn points when your files are downloaded or rated by other community members. Therefore, you should be very proud of yourself no matter you have 10 points or 10,000 points. It's the recognition from the community. See table below for detailed rules:
Now that we have reputation points on File Exchange, we introduced the short-term leaderboard to better view the points and rankings. You can filter by 7-day, 30-day, 365-day, and all-time, which helps you understand who is more active recently or who is a long-time contributor.
We hope the reputation and new leaderboard will contribute to the growth and success of File Exchange community. Your feedback is extremely valuable to us. Simply reply to this article if you have any questions, comments, or suggestions.
Chen Lin
Chen Lin
Last activity on 11 May 2020

Today, I'm spotlighting Rik, our newest and the 31st MVP in MATLAB Answers. Two weeks ago, we just celebrated Ameer Hamza for reaching the MVP milestone. Today, we are thrilled that we have another new MVP!

Since his first answer in Feb 2017, Rik has been contributing high-quality answers every quarter!

Besides those high-quality answers, Rik so far has submitted 21 files to File Exchange, one of which was chosen by MathWorks as the 'Pick of the Week'. Check the shining badge below.

Congratulations Rik! Thank you for your hard work and outstanding contributions.

hi how to apply single stream into multiple channels in fft simulink simulation from workspace

Sir how can we use Image processing in the Distance Learning

PB75
PB75
Last activity on 7 May 2020

Hi, Currently modelling an reciprocating engine coupled to a linear PMSM motor/generator for my PhD. I have downloaded the "Model File Package for Motor Control Design Public Video" simulink model.

Is it possible to convert to rotational PMSM simscape plant model used for a linear PMSM model? As there are none in the library to just drag into the existing control model.

Any ideas i can represent a linear motor based on this existing control model?

My output from the machine needs to be linear position w.r.t, with a total stroke of approximately 100 mm. Can i convert the rotational constant speed input at port "W" to a sinusoidal velocity profile (such that it replicates the velocity profile of a linear machine)?

Any help would be great.

Thanks

I wanted to briefly share my experience in transitioning from a hands-on lab course to a virtual lab in MATLAB. Here at UMass Amherst, Mechanical & Industrial Engineering, we have a required undergraduate lab sequence, one during junior year and another during senior year. I teach the 2nd course, MIE 402, with a focus on measurements, data acquisition, system dynamics, and control.
The main idea behind our labs, in addition to the all too important hands-on experience, is to provide the students with a platform where they can validate and understand limitations of theoretical models from experimental data.
While the hands-on aspect was lost, we were able to create virtual experiments that consisted on Simulink models saved as protected files. In our protected models, students were able to assign input variables, decide on simulation parameters (e.g., integration parameters), and have certain outputs saved to the workspace. The key for making this a challenging lab was twofold: (1) Students were not told about the level of modelling detail inside the protected file (e.g., were dry friction or electrical inductance included?) and (2) each student was assigned a different set of model parameters based on their student ID (via a predefined table inside the protected file). The 2nd point was especially impactful as students felt as if they are working on their own experiment.
We developed virtual labs for a tuned mass damper and a DC motor experiments. Feedback from the students showed that they missed the hands-on experience but really liked being able to interact, as many times as needed, with the virtual lab at their time frame of choice, and have the ability to interact with us (grad assistant and myself) then re-run the experiment to test new ideas.
Some future developments that could significantly enhance the educational impact of such virtual labs would be the addition of real-time animation and increased level of modelling (e.g., data acquisition effects, electromagnetics, etc.’). At UMass we presently do not have access to the entire suite of MATLAB tools, something that prevented us from including these ideas in our virtual labs.
This would have not been possible without Andy Bartlett (tremendous Simulink help) and Div Tiwari (quickly getting us access to required tools).

Professor Martin Trauth has shared lots of teaching resources on his MATLAB Recipes for Earth Sciences site. Now with the changes created by COVID, he's shifting his courses to online, including at-home phone-based data collection. Read how he's doing this and find additional resources: Teaching Data Analysis with MATLAB in COVID-19 Times (Trauth, Potsdam)

Today, I’m spotlighting Ameer Hamza , our newest MVP in Answers. Achieving MVP status is considered as a significant milestone and we know how hard it is to obtain 5,000 reputation points. Did you know Ameer earned 3000+ points and provided 1000+ answers in just 2 months? If you go to the leaderboard , you will find that Ameer ranks 1st in both 7-day leaderboard and 30-day leaderboard.

Due to Covid-19 pandemic, people have to stay at home and rely more on community for help. We have seen a significant increase in new questions per day. Luckily, we have a vibrant community! Many awesome contributors like Ameer double their effort to help people in need. Join me to thank Ameer and many other contributors!

A common question you may have when integrating MATLAB Grader into your LMS using the LTI standard is what information is being sent to MATLAB Grader from your LMS?

First, please familiarize yourself with the LTI specification on the IMS Global website: http://www.imsglobal.org/specs/ltiv1p1/implementation-guide

Next, take a look at the documentation we provide on LMS integration that is specific to your platform/vendor: https://www.mathworks.com/help/matlabgrader/lms-integration.html

MathWorks does not require personally identifiable information. More specifically, here are the standard LTI fields that we DO NOT want nor collect, as opposed to what fields we DO collect.

We do NOT want your LMS to send us: - user_image - lis_person_name_given - lis_person_name_family - lis_person_name_full - lis_person_contact_email

We DO require from your LMS: - roles

The other LTI fields listed in the specification are not related to personally identifiable information, and may be required for the LTI session to be launched successfully. For further questions about what is contained in the LTI specification, please refer to the specification and implementation guide provided by IMS, or contact the vendor of your LMS.

Starting in r2020a, AppDesigner buttons and TreeNodes can display animated GIFs, SVG, and truecolor image arrays.

Every component in the App above is either a Button or a TreeNode!

Prior to r2020a the icon property of buttons and TreeNodes in AppDesigner supported JPEG, PNG, or GIF image files specified by a character vector or string array but did not support animation.

Here's how to display an animated GIF, SVG, or truecolor image in an App button or TreeNode starting in r2020a. And for the record, "GIF" is pronounced with a hard-g .

Display an animated GIF

Select the button or TreeNode from within AppDesigner > Design View and navigate to Component Browser > Inspector > Button dropdown list of properties (shown below). Select an animated GIF file and set the text and icon alignment properties.

To set the icon property programmatically,

app.Button.Icon = 'launch.gif';  % or "launch.gif"

The filename can be an image file on the Matlab path (see addpath ) or a full path to an image file.

Display SVG

Use “scalable vector graphics” files for high-resolution images that are scaled to different sizes while preserving their shape and retaining their clarity. A quick and easy way to remember which plotting function is assigned to each button in an app is to assign an image of the plot to the button.

After creating the figure, expand the axes by setting the position or outerposition property to [0 0 1 1] in normalized units and save the figure using File > Save as and select svg format. Save the image to the folder containing your app. Then follow the same procedure as animated GIFs.

Display truecolor image

A truecolor image comes in the form of an [m x n x 3] array where each m x n pixel color is specified by an RGB triplet (read more) . This feature allows you to dynamically create a digital image or to upload an image from a mat file rather than an image file.

In this example, a progress bar is created within the uibutton callback function and it’s updated within a loop. For a complete demo of this feature see this comment .

% Button pushed function: ProcessDataButton
function ProcessDataButtonPushed(app, event)
    % Change button name to "Processing"
    app.ProcessDataButton.Text = 'Processing...';
    % Put text on top of icon
    app.ProcessDataButton.IconAlignment = 'bottom';
    % Create waitbar with same color as button
    wbar = permute(repmat(app.ProcessDataButton.BackgroundColor,15,1,200),[1,3,2]);
    % Black frame around waitbar
    wbar([1,end],:,:) = 0;
    wbar(:,[1,end],:) = 0;
    % Load the empty waitbar to the button
    app.ProcessDataButton.Icon = wbar;
    % Loop through something and update waitbar
    n = 10;
    for i = 1:n
        % Update image data (royalblue)
        % if mod(i,10)==0 % update every 10 cycles; improves efficiency
         currentProg = min(round((size(wbar,2)-2)*(i/n)),size(wbar,2)-2);
         RGB = app.ProcessDataButton.Icon;
         RGB(2:end-1, 2:currentProg+1, 1) = 0.25391; % (royalblue)
         RGB(2:end-1, 2:currentProg+1, 2) = 0.41016;
         RGB(2:end-1, 2:currentProg+1, 3) = 0.87891;
           app.ProcessDataButton.Icon = RGB;
          % Pause to slow down animation
          pause(.3)
          % end
      end
      % remove waitbar
      app.ProcessDataButton.Icon = '';
      % Change button name
      app.ProcessDataButton.Text = 'Process Data';
  end

The for-loop above was improved on Feb-11-2022.

Credit for the black & teal GIF icons: lordicon.com

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,...N i.e. the expected value of one die. For example, the expected value of a 6-sided die is 3.5.
Given N, simulate 1e8 N-sided dice rolls by creating a vector of 1e8 uniformly distributed random integers. Return the difference between the mean of this vector and the mean of integers from 1 to N.
function dice_diff = loln(N)
A=randi([1,N],1e8,1)
M=mean(A)
B=1:N
m=mean(B)
dice_diff =abs(M-m);
end
Here is my code, but it can't work out as it needs too long time to creat A.

can anyone advise which Matlab code I can add to the below codes to have Spectrogram Plot?

OptimalValuesx1y1z1 = [dataArray{1:end-1}];
%% Clear temporary variables
clearvars filename delimiter formatSpec fileID dataArray ans;
re=1;
fs=20e3/re;
datatable=OptimalValuesx1y1z1;
datatable=resample(OptimalValuesx1y1z1,1,re);
%datatable=lowpass(OptimalValuesx1y1z1,10,fs);
datatable(:,2)=datatable(:,2).*0.01;
figure
t=1/fs:1/fs:length(datatable)/fs;
plot(t, rms(datatable(:,2:4)*9.81,3));
ylim([0 10])  
xlim([0 10])
%ylim([0 1])
hold on
%plot(t,ones(1,length(datatable(:,2:4)*9.81))*12,'r--')
xlabel('Time [s]')
ylabel('Amplitude [m/s^2]')
legend('axis X','axis Y','axis Z','limit')
out_mean = mean(rms(datatable(:,2:4),3))
std_mean = std(rms(datatable(:,2:4),3))
% %PSD analysis
figure
x=datatable(:,2:4)*9.81;
nbar = 4;
sll = -30;
win = taylorwin(length(x),nbar,sll);
periodogram(x,win,[],fs);
xlim([0 1.624])
legend('axis X','axis Y','axis Z')

plz tell me the web site where i can easily install mathlab.

I want to use the Image fusions and deep neural network to detect the Corona-virus (COVID-19)

Hello, I want to generate Sinusoidal PWM for 3 level inverter. But I can not finding the way of connect these blocks togather. Is it possible to conenct them? Is there any other way to generate SPWM in simulink?

The File Exchange team is excited to announce that File Exchange now supports GitHub Releases!

Contributors can now develop software projects in GitHub without having to manually sync and maintain the same code in File Exchange.

To start using this feature, choose 'GitHub Releases' option when you update your existing File Exchange submission or link a new repository to File Exchange.

When you link your GitHub repository to File Exchange using GitHub Releases, your File Exchange submission will automatically update when you create a new release in GitHub that is compatible with File Exchange. In addition, if you package your code as a toolbox (.mltbx) and attach the toolbox package to your latest GitHub release, File Exchange will provide the toolbox to your users for download. If you do not attach a toolbox to the release, File Exchange will provide the zip release asset for download.

See this page for more details.

We encourage you to try out this feature and let us know of any feedback you have by replying below.

Hello everyone! I'm trying to find an optimal placement for a recloser using the optimization toolbox. The best place to set a recloser is defined by minimal SAIFI (system average interruption frequency index) value. I've created a little function where Nt - total number of customers, G - are some weights characterizing power lines, Xi - number of interrupted customers (if interruption happens in i-th line AND it has a recloser in it), Mi - row of 1 and 0 (that genetic algorithm should use as a gene I guess...) Here's the code of function:

function [S] = SAIFI_sum (M)
Nt=270;
G = [1.1 1.2 1.3 1.4 1.5 1.6];
X = [270 30 220 180 60 70];
  for i=1:length(M)
      if  M(i)== 1
      N(i) = X(i);
  else
          N(i) = Nt;
      end
  end
  S = 0;
  for j=1:length(M)
      SAIFI(j) = N(j)*G(j);
      S = S + SAIFI(j);
  end
   S
end
As a result I have 51 same results: S = 297 and following message:
"Optimization running.
Objective function value: 297.0
Optimization terminated: average change in the fitness value less than options.FunctionTolerance".
I couldn't understand how to solve this problem.

This week is National Volunteer Week in the USA and Canada and to celebrate, I’d like to pay tribute to the volunteers in the Matlab Central Answers forum who have given countless hours to help total strangers make progress in their education, careers, and hobbies.

As of April 20, 2020, there have been 375,869 [1,2] questions asked by 183,968 [3] contributors dating back to the earliest existing question on January 4, 2011.

41,890 volunteers have contributed at least one answer leading up to 68% of the questions answered.

There is no contribution too small for earning well-deserved recognition and appreciation. A single answer or comment may benefit countless individuals who finally find the ideal solution to a problem that kept them up at night.

A number of volunteers in the forum have contributed far and beyond the imaginable and have shared so much of their time and expertise that it’s difficult to fathom. The bar graph below shows the top 10 volunteers in the forum by the number of answers provided. It’s hard to believe that Walter Roberson , a single individual ( we think ), has contributed a portion of answers equal to more than 18% of answered questions in the forum [4]. The top two volunteers, adding Image Analyst , contributed enough answers to equal almost 30% of the answered questions. These folks along with many others not listed in the bar graph who can be found on the contributors page are the foundation of so many Matlab users’ success including my own from June 2014, when I asked my first question.

Whether you’ve come to the forum to look for an answer or to write an answer, you’re undoubtedly standing on the shoulders of giants.

Footnotes

  1. Based on the number of answered and unanswered questions listed in the ‘Status’ table in recently added questions .
  2. Questions and answers posted by the MathWorks Support Team are not included in the data presented here, though much appreciated.
  3. The number of people who provided an answer is based on sorting the contributors page by ‘answers given’ in descending order.
  4. Since a contributor can write more than one answer to a question, we can’t easily measure the number of questions answered by a contributor.

Created and tested in the university classroom, the Introduction to MATLAB zyBook includes automated assessment using MATLAB Grader. Learn how to create custom MATLAB assignments using zyLabs and provide feedback.

Join this webinar running April 21st and 23rd