MATLAB Central Discussions - Join the conversation!
メインコンテンツ

結果:


Nowadays, many instructors are integrating AI to their courses. In a distance learning setting, the hardware students use to train their models vary. Training time of the deep learning models can be shortened with a pool of GPUs, CPUs or a pool of CPUs and GPUs locally or in the cloud. Accuracy of the results can depend on the hyperparameters used to train the models.

In MATLAB, Experiment Manager (introduced in R2020a) makes it easy to train networks with various hyperparameters and compare the results. Different models can be run in parallel by clicking on “Use Parallel” button in Experiment Manager App. But what if your computer has multiple CPU cores and a GPU? Would you be able to use Experiment Manager with a pool of CPUs and a GPU? The answer is “yes”. For example, my computer has 1 NVIDIA GPU and an 8 core CPU. To use all these computational resources, I typed these lines in my command window in MATLAB:

parpool(9);
spmd
if labindex==1
gpuDevice(1); %select GPU on worker 1
else
gpuDevice([]); %deselect GPU on remaining workers
end

Then, I clicked on “Use Parallel” button in Experiment Manager and used a modified setup function in Experiment Manager to change the execution environment from CPU to GPU:

if isempty(parallel.gpu.GPUDeviceManager.instance.SelectedDevice)
options=trainingOptions(~,"ExecutionEnvironment",'cpu');
else
options=trainingOptions(~,"ExecutionEnvironment",'gpu');
end 

Default training options automatically use an NVIDIA GPU if there is one, and specific hardware can be selected using “ExecutionEnvironment” in the trainingOptions.

If you like to learn more about the fundamentals of parallel computing, check out “Parallel Computing Fundamentals” on our documentation and gain some hands-on experience with Parallel Computing through "Parallel Computing Hands-On Workshop" .

Educators use MATLAB Grader to automatically grade MATLAB code, to provide feedback to their students and to scale assessments for large lectures. If you use MATLAB Grader in our browser-based environment at grader.mathworks.com you can view various individual and aggregate student performance analytics. You can export the MATLAB Grader Assignment Report to analyze your student’s performance in more detail:

To make things easy for you, we provide a utility to create customizable assignment reports from the MATLAB Grader Assignment Report. With this utility you can quickly make lists of students with a metric that defines how well they solved the problems within the assignment. You can explore the number of problems each student solved correctly, calculate the mean percentage score they received for the problems or specify points per problem and calculate the points they scored on the assignment.

Please download the utility Customizable Assignment Report for MATLAB Grader from File Exchange. If you are new to MATLAB Grader, watch the MATLAB Grader Overview video and try the interactive Teaching with MATLAB online course (Section 6 is about MATLAB Grader).

An earlier tip suggested using MATLAB Drive to share and collaborate with others using MATLAB Online or MATLAB on desktop systems. Starting in MATLAB R2021a, there is yet another advantage of using this approach – the 'matlabdrive' function returns the path to the folder that contains the content of your MATLAB Drive.

After sharing their files, instructors sometimes direct students to navigate to a specified folder or add certain folders to the MATLAB search path. This ensures that MATLAB can discover the scripts, functions, and other files contained within. Since the MATLAB Drive folder may be installed in different locations on each users’ computer, this could not be done programmatically. Unfortunately, students may miss these instructions and encounter errors. The same can happen between peers working in groups.

Add the matlabdrive function in your code to obtain the path of the MATLAB Drive folder. You can then use functions cd and fullfile to navigate directly to that location or a subfolder. With addpath, you can also add these to the MATLAB search path. For example,

>> drivePath = matlabdrive 
drivePath = 'C:\Users\username\MATLAB Drive' 
>> folderPath = fullfile(matlabdrive, ‘myfolder’) 
folderPath = 'C:\Users\username\MATLAB Drive\myfolder’ 
>> cd(folderPath)	% Change current folder to ‘myfolder’ in MATLAB Drive 

You can run matlabdrive from your desktop or from other MATLAB environments such as MATLAB Online. On desktop systems, you must have MATLAB Drive Connector installed. If MATLAB is unable to find the MATLAB Drive folder, matlabdrive returns an error.

The Symbolic Math Toolbox includes functions for solving, visualizing, and manipulating symbolic math equations. In combination with MATLAB’s Live Editor, it provides an easy, intuitive, and complete environment to interactively learn and teach algebra, calculus, and ordinary differential equations.

Starting with MATLAB R2021a, you can represent matrices and vectors in compact matrix notation with a new symbolic matrix variable data type. This enables a concise typeset display and show mathematical formulas with more clarity. Using them, you can show matrix- and vector-based expressions the way they are displayed in textbooks.

Contrast the visual difference between matrices of symbolic scalar variables and the new symbolic matrix variables:

The syms and symmatrix functions create symbolic matrix variables. To convert a symbolic matrix variable to an array of symbolic scalar variables, use symmatrix2sym. For an example, see Create Symbolic Matrix Variables.

David Gershon
David Gershon
最後のアクティビティ: 2021 年 8 月 4 日

My simulink program require a feedback loop from an AC signal. How does one create a mean/ median value from a sinusoidal signal. Specifically, I want to average a power signal for last 0.1 sec and then adjust PWM signal.

Div Tiwari
Div Tiwari
最後のアクティビティ: 2021 年 7 月 23 日

If your university is among the thousands worldwide with a Campus-Wide License, you have unlimited access to all MathWorks products. Therefore, when sharing your MATLAB code online or with collaborators and students, you may want to verify which add-ons or toolboxes it requires. You may also have received files and want to determine missing add-ons or toolboxes you need to install in order to run it.

Starting in R2021a, MATLAB’s Dependency Analyzer detects and lists required add-ons, including apps and toolboxes, for a whole MATLAB Project or for selected files. It can also identify which file is introducing a product dependency. For more details, see Find Required Products and Add-Ons.

Santosh Kasula
Santosh Kasula
最後のアクティビティ: 2021 年 8 月 14 日

All the players now have the ability to filter the Cody problems based on the difficulty level. You can also sort based on the difficulty level. Try it out and let us know what you think.

Improving accessibility in higher education – whether on-campus or virtual – is important to ensure the learning experience accommodates all. MathWorks is committed to improving the accessibility of its software products for users with disabilities.

In MATLAB Online, you can use a screen reader to interact with the Command Window, create and edit scripts and functions in the Editor, and navigate through the MATLAB desktop tools. For more information, refer to the documentation page Use a Screen Reader in MATLAB Online .

You can learn more and sign up for usability research to improve the accessibility of MATLAB Online in the Accessibility Statement for MATLAB page.

Chen Lin
Chen Lin
最後のアクティビティ: 2021 年 8 月 4 日

The community team is pleased to release a new design for File Exchange review section. The new design has addressed major pain points we heard from File Exchange users and improves the overall experience. Major improvements include:

1. Support editing ratings/comments

Editing is probably the most popular feature request from File Exchange users. Now, you are able to edit your ratings/comments. Simply click the ‘Edit’ link below your content.

2. Support replying to a comment

In the old design, the only way for the file author to reply to a comment is to create a new comment, which is very hard to track. With the new design, the authors can directly reply to a comment and their post has a blue background making it easier to see. Due to differences between the old and new commenting structures, replies to comments couldn't be reliably inferred, so all comments added prior to 7/14 are at the same indentation level. Replies will be indented from now on.

3. Support rich formatting and attachments

Using the new rich text editor, you are able to choose bold/italic text, insert code or image, create lists, or attach files.

4. Introduce the ‘Discussions’ tab

There is a new ‘Discussions’ tab where community users have conversations with the author or other community members for Q&As or general discussions. The discussions section supports threaded discussions to facilitate the conversations. We separate Discussions with Reviews so that different types of content are not mixed together.

This is a major change for File Exchange and we look forward to hearing from you. Simply reply to this article if you have any questions, comments, or suggestions.

Let me share with you how at TH Rosenheim we continued to conduct project-based engineering education with our students that could be conducted at home and outside.

How can students study and learn the development process on a real example? Three Master students from TH Rosenheim elaborated those steps on the design, simulation, manufacturing and the launch of a water rocket. The propulsion force comes from air, that is pumped into cola bottle with water inside. The bottle serves as pressure chamber; a fast opening of the bottle expels the water and pushes the rocket up. The right mixture of air and water has an influence on the reachable height. This was analysed and optimized. The pressure chamber has been with modern CAD tools and modelled by Finite-Element Methods and designed to sustain a pressure of up to 20 bar.

Attached to the rocket are the fins for aerodynamic stabilisation. A service module was set on top. It contains the survival mechanism of the rocket – a parachute, which needs to be expelled at the right moment in time. The proper command comes from the Raspberry Pi inside the module, the brain of the rocket. It collects and stores the sensor data and commands timer controlled the cap of the rocket to be opened to start a safe landing. The flight of the rocket has been simulated with the original CAD designed parts including launch site and animated using the Virtual Reality Toolbox. You find the 5-minutes-movie of the project here.

Do you have tips or questions? Do you know of similar projects? Then contact me!

Best regards,

Peter Zentgraf

MATLAB Drive provides a common cloud-based storage location for your scripts, live scripts, and other MATLAB files. All files you place in your MATLAB Drive get backed up in the cloud. You can use it to send either a personal invitation or a view-only link to a shared folder. Its close integration with MATLAB and MATLAB Online make it the easiest way to share and collaborate with other MATLAB users.

For example, instructors can share a read-only folder of class material with their students. Students can collaborate with peers on a common shared folder for group projects, and subsequently share it with their instructor for assessment. Thanks to full integration with MATLAB Online, you can view, modify, and run such shared files from within a web browser with just a few clicks.

Use MATLAB Drive Connector to sync your files between your computers and MATLAB Online, eliminating the need for manual upload or download.

Chen Lin
Chen Lin
最後のアクティビティ: 2021 年 6 月 26 日

Community members learn about each other or track their own activities via community profile pages. To improve the user experience and address pain points, the community team has redesigned the entire page.

The biggest improvement is we replaced the cards and slider with a dashboard. In this Dashboard, you can easily track your activities by timeline and filter them by different applications (Answers, File Exchange, etc.). All of your stats, such as ranking and reputation, and badges earned are included in one dashboard. If you are looking at your own profile, there are tabs for managing followed content and communication preferences. We also introduced a content feed section, which brings together your contributions alongside your followed content

We encourage you to explore the new profile page. If you have any questions, comments, or suggestions, let us know by leaving a reply to this thread.

New design:

Old design:

Jiro Doke
Jiro Doke
最後のアクティビティ: 2021 年 6 月 26 日

With MATLAB Online, your students do not need a high-end computer to install and use MATLAB. Instead, they just need a web-connected computer. MATLAB Online lets students connect their webcam to capture live videos and images. Here’s an example of performing a simple object detection using a pretrained neural network called AlexNet and a live feed from a webcam. Google Chrome™ is required for webcam support.

Read more about it in the documentation, or take a look at this video for additional examples.

Are you looking for ideas to provide students a more effective learning experience in an online or hybrid environment? A collection of videos on Online Teaching with MATLAB and Simulink demonstrates resources for providing hands-on experience with MATLAB and Simulink, plus examples of delivering instruction, engaging students using virtual labs and projects, and assessing outcomes in your preferred learning platform.

View ‘Online Teaching with MATLAB and Simulink’ video series

Several educators worldwide use MATLAB Grader to scale assessments and automatically grade MATLAB coding assignments. MATLAB Grader can be used in any learning environment, for both formative assessments with automated feedback and summative assessments, such as quizzes and exams.

To get you started easily, you can access MATLAB Grader problem collections that include domains like Calculus, Programming, Dynamics, and more. Adapt these examples to your curriculum or use them as is to generate quick exercises for your students and reinforce MATLAB skills. The examples illustrate some best practices for how to design assessments, test for common errors, and write rich feedback for students to help them iterate and improve on their solutions.

Request access to the problem collections through Customer Support or your assigned Customer Success Engineer or Account Representative. They ensure that only authorized instructors gain access to the problem collections.

If you are new to MATLAB Grader, watch the MATLAB Grader Overview video and try the interactive Teaching with MATLAB online course (Section 6 is about MATLAB Grader).

Melda Ulusoy
Melda Ulusoy
最後のアクティビティ: 2021 年 6 月 6 日

Check out the following webinar by Prof. Rick Hill to learn how you can use the new interactive Live Script Control Tutorials for MATLAB and Simulink for your teaching! Examples demonstrate interactive control design with Bode plots, Nyquist diagrams, engaging animations, and much more.

https://www.youtube.com/watch?v=ZMWYlmqapfc

One of the objectives of lab-based instruction can be to develop students’ familiarity with hardware equipment. When students could no longer come to their lab in person, educators at HTW Dresden developed a MATLAB app using App Designer to replicate the controls on lab equipment such as a signal generator and oscilloscope. Read this article to learn more about how Dr. Henker and Dr. Kelber virtualized their electrical engineering labs.

If you use Simulink or Simscape models for your virtual labs, you can create an interactive display of controls and displays within your model diagram using blocks from the Dashboard library. To do so, connect block parameters to control blocks (knobs, buttons, and switches) and signals to displays blocks (scopes and gauges).

New customizable Knob, Vertical Slider, and Horizontal Slider blocks introduced in R2021a let you choose your own background image, foreground image, handle or slider image, and scale appearance. By combining these with custom gauge blocks, you can create intuitive and photo-realistic dashboards for interacting with your models, such as in the image below.

View examples of controlling simulations with interactive displays, or read some more Tips for Moving your Lab-based Classes Online.

Pavel Tinnikov
Pavel Tinnikov
最後のアクティビティ: 2021 年 6 月 11 日

I am trying to simulate the PMSM in fault mode with phase loss at 0.25 sec, but the simulation results are incorrect. For example, the rotor speed changes too much when a phase is missing. I tried to assemble the model in dq coordinates and abc coordinates on my own, but the results are the same. Who can tell you how to modify the engine model so that the simulation shows the correct results?

Adam Danz
Adam Danz
最後のアクティビティ: 2022 年 9 月 21 日

Starting in MATLAB R2021a axis tick labels will auto-rotate to avoid overlap when the user manually specifies ticks or tick labels ( release notes ). In custom visualization functions, the tick label density or tick label lengths may be variable and unknown. The new auto-rotation feature removes the burden of detecting the need to rotate manually-set labels and eliminates the need to manually rotate them.

Many properties and combinations of properties can cause tick labels to overlap if they are not rotated.

  • Length of tick labels
  • Number of tick labels
  • Interval between tick labels
  • Font size
  • Font name
  • Figure size
  • Axes size
  • Viewing angle of the axes

Demo: varying tick density and length of tick labels

These 9 axes vary by the number of x-ticks and length of x-tick-labels. MATLAB auto-rotates the labels when needed.

Demo: Changes to axis view angle and rotation

The auto-rotation feature updates the label angles as the axes change programmatically or during user interaction.

What if I don't want auto-rotation?

Auto-rotation mode is on by default for each X|Y|Z axis. When the tick label rotation angle is manually set from the X|Y|ZTickLabelRotation property of axes or by using xtickangle | ytickangle | ztickangle , auto-rotation is turned off. Auto-rotation can also be turned off by setting the X|Y|ZTickLabelRotationMode axis property to manual but it's important to also hold the axis properties so that the rotation mode does not revert to the default value, auto. If you're looking for a broader method of reverting to older behavior you can set the default label rotation mode to manual at the start of a function that produces multiple plots and then revert to the factory default rotation mode at the end of the file (consider using onCleanup).

set(groot,'defaultAxesXTickLabelRotationMode','manual')
set(groot,'defaultAxesYTickLabelRotationMode','manual')
set(groot,'defaultAxesZTickLabelRotationMode','manual')
% Revert to factory-default
set(groot,'defaultAxesXTickLabelRotationMode','remove')
set(groot,'defaultAxesYTickLabelRotationMode','remove')
set(groot,'defaultAxesZTickLabelRotationMode','remove')

A copy of this Community Highlight is attached as a live script.

Go to top of page