Results for
Sir how can we use Image processing in the Distance Learning
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
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
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
- Based on the number of answered and unanswered questions listed in the ‘Status’ table in recently added questions .
- Questions and answers posted by the MathWorks Support Team are not included in the data presented here, though much appreciated.
- The number of people who provided an answer is based on sorting the contributors page by ‘answers given’ in descending order.
- 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
Here is a great video from Gartner in response to COVID-19 and trends they are seeing for schools transitioning to Distance Learning. We hope this is helpful! See here: Gartner Research
I organized in September 2019 a one-week workshop in a hybrid set-up (students could attend the workshop either on-site or fully on-line). Beyond the hybrid nature of the workshop, the workshop was "flipped": the workshop attendees had to study some handbook specifically written for the workshop, watch some short videos summarizing the main concepts and answer online quizzes. During the workshop, most of the time was spent on hands-on coding exercises and assignments, during which the workshop attendees had to apply the concepts presented in the handbook and videos.
All coding exercises and assignments were carried out with MATLAB Grader. The platform provided the same coding environment to all workshop attendees, irrespective of whether they attended the workshop on-site or remotely. Furthermore, by providing a coding template and rigorous assessment tests along each exercise, having all students converging to the right "solution" was painless. It allowed me, as a teacher, to entirely focus on helping the students in solving those exercises, which was extremely rewarding.
This teaching set-up, combined with smart IT solutions as e.g MATLAB Grader, favors deep student learning, since the students learn by doing (active learning) and are continuously supported by the teacher in their learning.
I will soon teach in another course along the same principles. The course was supposed to be given on-site only, but because of the outbreak of Covid-19, it will be given entirely online. Thanks to MATLAB Grader, the migration to a online set-up is straightforward.
In case you want to read more about some of my past efforts in the development and application of student-centred pedagogical approaches, you can read more about those at: https://www.chalmers.se/en/departments/physics/news/Pages/Teaching-the-algorithms-that-are-crucial-for-nuclear-reactor-modelling.aspx and https://www.chalmers.se/en/departments/physics/news/Pages/Online-educational-efforts-to-ensure-nuclear-safety.aspx
I will also be glad to answer questions and provide help to those of you who want to get started with online teaching.
Christophe
New to r2020a, leapseconds() creates a table showing all leap seconds recognized by the datetime data type.
>> leapseconds() ans = 27×2 timetable Date Type CumulativeAdjustment ___________ ____ ____________________ 30-Jun-1972 + 1 sec 31-Dec-1972 + 2 sec 31-Dec-1973 + 3 sec 31-Dec-1974 + 4 sec 31-Dec-1975 + 5 sec << 21 rows removed >> 31-Dec-2016 + 27 sec
Leap seconds can covertly sneak into your data and cause errors that are difficult to resolve if the leap seconds go undetected. A leap second was responsible for crashing Reddit , Mozilla, Yelp, LinkedIn and other sites in 2012.
Detect leap seconds present in a vector of years
% Define a vector of years t = 2005:2008;
allLeapSeconds = leapseconds(); isYearWithLeapSecond = ismember(t,year(allLeapSeconds.Date));
% Show years that contain a leap second t(isYearWithLeapSecond) ans = 2005 2008
Detect leap seconds present in a vector of months
% Define a vector of months t = datetime(1972, 1, 1) + calmonths(0:11);
t.Format = 'MMM-yyyy'; allLeapSeconds = leapseconds(); [tY,tM] = ymd(t); [leapSecY, leapSecM] = ymd(allLeapSeconds.Date); isMonthWithLeapSecond = ismember([tY(:),tM(:)], [leapSecY, leapSecM], 'rows');
% Show months that contain a leap second t(isMonthWithLeapSecond) ans = 1×2 datetime array Jun-1972 Dec-1972
List all leap seconds in your lifetime
% Enter your birthday in mm/dd/yyyy hh:mm:ss format yourBirthday = '01/15/1988 14:30:00';
yourTimeRange = timerange(datetime(yourBirthday), datetime('now')); allLeapSeconds = leapseconds(); lifeLeapSeconds = allLeapSeconds(yourTimeRange,:); lifeLeapSeconds.YourAge = lifeLeapSeconds.Date - datetime(yourBirthday); lifeLeapSeconds.YourAge.Format = 'y';
% Show table fprintf('\n Leap seconds in your lifetime:\n') disp(lifeLeapSeconds)
Leap seconds in your lifetime: Date Type CumulativeAdjustment YourAge ___________ ____ ____________________ __________ 31-Dec-1989 + 15 sec 1.9587 yrs 31-Dec-1990 + 16 sec 2.958 yrs << 8 rows removed >> 30-Jun-2012 + 25 sec 24.456 yrs 30-Jun-2015 + 26 sec 27.454 yrs 31-Dec-2016 + 27 sec 28.96 yrs
What is a leap second?
A second is defined as the time it takes a cesium-133 atom to oscillate 9,192,631,770 times under controlled conditions. The transition frequency is so precise that it takes 100 million years to gain 1 second of error [1]. If the earth’s rotation were perfectly synchronized to the atomic second, a day would be 86,400 seconds. But the earth’s rate of rotation is affected by climate, winds, atmospheric pressure, and the rate of rotation is gradually decreasing due to tidal friction [2,3]. Several months before the expected difference between the atomic clock-based time (UTC) and universal time (UT1) reaches +/- 0.9 seconds the IERS authorizes the addition (or subtraction) of 1 leap second (see plot below). Since the first leap second in 1972, all leap second adjustments have been made on the last day of June or December and all adjustments have been +1 second which explains the + signs in the type column of the leapseconds() table.
[ Image source ]
How to reference the leap second schedule in your code
Since leap second adjustments are not regularly timed, you can record the official IERS Bulletin C version used at the time of your analysis by accessing the 2nd output to leapseconds().
[T,vers] = leapseconds
What do leap seconds look like in datetime values?
A minute typically has 60 seconds spanning from 0:59. A minute containing a leap second has 61 seconds spanning from 0:60.
December 30, 2016 was a normal day. If we add the usual 86400 seconds to the start of that day, the result is the start of the next day.
d = datetime(2016, 12, 30, 'TimeZone','UTCLeapSeconds') + seconds(86400) d = datetime 2016-12-31T00:00:00.000Z
The next day, December 31, 2016, had a leap second. If we add 86400 seconds to the start of that day, the result is not the start of the next day.
d = datetime(2016, 12, 31, 'TimeZone','UTCLeapSeconds') + seconds(86400) d = datetime 2016-12-31T23:59:60.000Z
When will the next leap second be?
As of the current date (April 2020) the timing of the next leap second is unknown. Based on the data from the plot above, what's your guess?
References
This Coursera course teaches computer programming to those with little to no previous experience: https://www.coursera.org/learn/matlab
Your students might find this course a useful introduction to programming.
I took a course on Medical Image Processing from one of the instructors, Prof Mike Fitzpatrick, when I was a graduate student at Vanderbilt University a few decades ago. He's a great instructor who helped get me hooked on MATLAB for learning, teaching and researching!
There’s a webinar on online learning tools with MATLAB this Friday. It’s for time zones in Asia Pacific.
Register if you’re interested!