メインコンテンツ

結果:


Chen Lin
Chen Lin
最後のアクティビティ: 2020 年 10 月 1 日

We are excited to announce that Cody Contest 2020 starts today! Again, the rule is simple - solve any problem and rate its difficulty. If you have any question, please visit our FAQs page first. Want to know your ranking? Check out the contest leaderboard .

Happy problem-solving! We hope you are a winner.

Adam Danz
Adam Danz
最後のアクティビティ: 2024 年 3 月 14 日

'
The Matlab r2020b release introduces the new horizontal ('_') and vertical (' | ') line marker symbols that are centered around the coordinate similarly to the plus marker ('+').
plot(x,y,'_')
plot(x,y,'|')
See the attached Live Script to reproduce all plots in this post.
'
Use case example 1: Days in August 2020 that COVID-19 cases (vertical ticks) and number of tests (horizontal ticks) increased from the previous day in countries with populations greater than 100M (4 countries eliminated for incomplete data).
'
Use case example 2: (An alternative to stacked bar plots) Number of power outages in 2005 across regions of the USA, broken down by calendar quarters.
Christopher Stapels
Christopher Stapels
最後のアクティビティ: 2020 年 9 月 29 日

One great thing about IoT projects is they are connected to the internet, and that creates an opportunity to collaborate at a distance. Here are resources to help you teach classes that involve remote learning.

  • Record and visualize your experiment's data in ThingSpeak channels. For example, this public soil monitor channel shows measurements from a sensor connected to a plant. You can see the ThingSpeak example pages for help getting your experiment connected.

Figure 1: Fitvirus sample results.

When you can’t make it into the lab, use ThingSpeak to monitor and control your lab equipment for experiments and for teaching.

  • When you use ThingSpeak channel values to control your hardware modes, students can run experiments from home, and even collaborate with others to control devices and collect data for analysis.

Figure 2: Sample ThingSpeak lab model.

  • Build a simulation model to deploy on hardware and control it remotely. Watch this video to see how you can do both simulation and deployment in the same Simulink model. You can also download the models used in the video.
  • Use ThingSpeak to analyze your data. Use the provided code templates (like this one for removing outliers from wind speed data) or custom MATLAB code to filter and analyze your data and schedule it to run at regular intervals.

regularFlag = isregular(data,'Time')

PB75
PB75
最後のアクティビティ: 2020 年 9 月 30 日

Hi All,

Looking for guidance on how to represent a PMSM 3-Phase Converter (DC bus to AC) as a simply 1st Order Transfer Function in my Simulink model.

Researching this, have found we can show the Power Converter as a simple gain and time delay such as G_inv(s) = K_Inv/(1 + T_inv s)

The gain requires V_cm, which is the control voltage, is this control voltage the "Forward Voltage, Vf" in Switching Devices tab in the block?

Is my assumption for the tf for the converter correct?

Thanks

Patrick

Please join Loren Shure for her live sessions on the MATLAB YouTube channel starting October 1st and continuing through November 19th. You know Loren from her popular blog Loren on the Art of MATLAB.

Chen Lin
Chen Lin
最後のアクティビティ: 2020 年 11 月 24 日

Solve coding problems. Improve MATLAB skills. Have fun. See details and register .

IFM
IFM
最後のアクティビティ: 2020 年 9 月 23 日

I get students to create some figures in MATLAB Grader. Is there anyway the students can save the figure on their computer? I have tried savefig and that doesn't seem to do anything.

Adam Danz
Adam Danz
最後のアクティビティ: 2020 年 9 月 22 日

Add a subtitle

Multi-lined titles have been supported for a long time but starting in r2020b, you can add a subtitle with its own independent properties to a plot in two easy ways.

  1. Use the new subtitle function: s=subtitle('mySubtitle')
  2. Use the new second argument to the title function: [t,s]=title('myTitle','mySubtitle')
figure()
tiledlayout(2,2)
% Method 1
ax(1) = nexttile;
th(1) = title('Pupil size'); 
sh(1) = subtitle('Happy faces');
ax(2) = nexttile;
th(2) = title('Pupil size'); 
sh(2) = subtitle('Sad faces');
% Method 2
ax(3) = nexttile;
[th(3), sh(3)] = title('Fixation duration', 'Happy faces'); 
ax(4) = nexttile;
[th(4), sh(4)] = title('Fixation duration', 'Sad faces'); 
set(ax, 'xticklabel', [], 'yticklabel', [],'xlim',[0,1],'ylim',[0,1])
% Set all title colors to orange and subtitles colors to purple.
set(th, 'Color', [0.84314, 0.53333, 0.1451])
set(sh, 'Color', [0, 0.27843, 0.56078])

Control title/Label alignment

Title and axis label positions can be changed via their Position, VerticalAlignment and HorizontalAlignment properties but this is usually clumsy and leads to other problems when trying to align the title or labels with an axis edge. For example, when the position units are set to 'data' and the axis limits change, the corresponding axis label will change position relative to the axis edges. If units are normalized and the axis position or size changes, the corresponding label will no longer maintain its relative position to the axis, and that's assuming the normalized position was computed correctly in the first place.

Starting in r2020b, title and axis label alignment can be set to center|left|right, relative to the axis edges.

  • TitleHorizontalAlignment is a property of the axis: h.TitleHorizontalAlignment='left';
  • LabelHorizontalAlignment is a property of the ruler object that defines the x | y | z axis: h.XAxis.LabelHorizontalAlignment='left';
% Create data
x = randi(50,1,100)'; 
y = x.*[.2, -.2] + (rand(numel(x),2)-.5)*10; 
gray = [.65 .65 .65];
% Plot comparison between columns of y
figure()
tiledlayout(2,2,'TileSpacing','none')
ax(1) = nexttile(1);
plot(x, y(:,1), 'o', 'color', gray)
lsline
ylabel('Y1 (units)')
title('Regression','Y1 & Y2 separately')
ax(2) = nexttile(3);
plot(x, y(:,2), 'd', 'color', gray)
lsline
xlabel('X Label (units)')
ylabel('Y2 (units)')
grid(ax, 'on')
linkaxes(ax, 'x')
%  Move title and labels leftward
set(ax, 'TitleHorizontalAlignment', 'left')
set([ax.XAxis], 'LabelHorizontalAlignment', 'left')
set([ax.YAxis], 'LabelHorizontalAlignment', 'left')
% Combine the two comparisons into plot and flip the second 
% y-axis so trend are in the same direction
ax(3) = nexttile([2,1]);
yyaxis('left')
plot(x, y(:,1), 'o')
ylim([-6,16])
lsline
xlabel('X Label (units)')
ylabel('Y1 (units) \rightarrow')
yyaxis('right')
plot(x, y(:,2), 'd')
ylim([-16,6])
lsline
ylabel('\leftarrow Y2 (units)')
title('Direct comparison','(Y2 axis flipped)')
set(ax(3),  'YDir','Reverse')
% Align the ylabels with the minimum axis limit to emphasize the
% directions of each axis. Keep the title and xlabel centered
ax(3).YAxis(1).LabelHorizontalAlignment = 'left';
ax(3).YAxis(2).LabelHorizontalAlignment = 'right';
ax(3).TitleHorizontalAlignment = 'Center';       % not needed; default value.
ax(3).XAxis.LabelHorizontalAlignment = 'Center'; % not needed; default value.
Chen Lin
Chen Lin
最後のアクティビティ: 2021 年 1 月 23 日

Below are some FAQs for the Cody contest 2020. If you have any additional questions, ask your questions by replying to this post. We will keep updating the FAQs.

Q1: If I rate a problem I solved before the contest, will I still get a raffle ticket?

A: Yes. You can rate any problem you have solved, whether it was before or during the contest period.

Q2: When will I receive the contest badges that I've earned?

A: All badges will be awarded after the contest ends.

Q3: How do I know if I’m the raffle winner?

A: If you are a winner, we will contact you to get your name and mailing address. You can find the list of winners on the Cody contest page .

Q4: When will I receive my T-shirt or hat?

A: You will typically receive your prize within a few weeks. It might take longer for international shipping.

Q5: I'm new to Cody. If I have some questions about using Cody, how can I get help?

A: You can ask your question by replying this post. Other community users might help you and we will also monitor the threads. You might also find answers here .

Q6: What do I do if I have a question about a specific problem?

A: If the problem description is unclear, the test suite is broken, or similar concerns arise, post your question(s) as a comment on the specific problem page. If you are having a hard time solving a problem, you can post a comment to your solution attempt (after submitting it). However, do not ask other people to solve problems for you.

Q7: If I find a bug or notice someone is cheating/spamming during the contest, how can I report it?

A: Use Web Site Feedback . Select "MATLAB Central" from the category list.

Q8: Why can't I rate a problem?

A: To rate a problem, you must solve that problem first and have at least 50 total points.

It's pretty odd how a solution that uses more characters than usual can be the "leading solution" of a Cody problem and have the least size. Compare these two codes that find the sum of integers from 1 to 2^x, which one uses fewer characters, thus should be the better solution?
function y = sum_int(x)
regexp '' '(?@y=sum(1:2^x);)'
end
function ans = sum_int(x)
sum(1:2^x)
end
An
An
最後のアクティビティ: 2020 年 11 月 9 日

Dear power electronics control community,

Since I have not solved the problem and have not found an answer to why I receive such an output, I would be happy when you could help me out. The actual project is much more extensive but easy schematic of what I want to do is here:

For that, I am using 2-level PWM generator: https://se.mathworks.com/help/physmod/sps/powersys/ref/pwmgenerator2level.html In the DC-link (DC voltage after the converter) the DC voltage output should be more-less constant (with a little noise) but right now it very far away from the desired output:

Does anyone have a idea what might cause this problem?

Jiro Doke
Jiro Doke
最後のアクティビティ: 2020 年 8 月 21 日

Take a look at this video on remote access robotics lab. It allows students to submit algorithms and have them run on a robot completely remotely.

Robotarium

Here (16:56) is where the submission process is explained.

Professor Christophe Demaziere from Chalmers University of Technology, Sweden created a short course on nuclear reactor modeling.

  • The course followed a flipped and hybrid approach last year but will most likely be taught entirely online in future due to Covid-19 pandemic.
  • MATLAB Grader greatly facilitates the Online nature of Christophe's courses.
  • Student Feedback was also very positive saying that they learned better compared to the traditional approach.

More details in the article

I'm trying to list out some videos, courses, and other links to learn more about Machine and Deep Learning. Here are some links to getting started with AI/Machine Learning/Deep Learning with MATLAB:

Artificial Intelligence:

Machine Learning:

Data Analytics:

Neural Networks and Deep Learning:

If any of you are using other resources from the MathWorks website or elsewhere, please consider adding it below as a comment.

Thanks!

Hello,

I am a student. I am currently looking into graph neural networks (GNNs). My domain is electrical power systems. In electrical power systems, it is extremely important that we get an accurate desired output numerical value of electrical data from a neural network.

1) I have a basic question. Consider an electrical grid network of nodes. I am trying to learn this electrical grid network data using Graph Neural Network (GNN). Every node of a GNN accumulates data from neighboring nodes, then processes it by a few steps of an algorithm, and passes it to the next layer. Finally, data is passed through a non-linearity and then to the output layer of the GNN.

But, if I feed electrical data to the above process, the original value of data at every node gets manipulated by several processing operations, and especially after passing the manipulated data through a non-linearity at the final stage, the output is obtained only in the form of 1's and 0s. Hence, the original electrical data value at every node is totally lost. On the contrary, I am expecting an output of an "accurate" value of electrical data similar to original value electrical data at every node of the network.

How to address the above problem? Please explain systematically if possible. This is a genuine basic question.

2) Also, does anyone have a clue, why Graph Neural Networks (GNNs) have not been introduced yet as a toolbox or in general in Matlab?

Help and opinion on above questions would be greatly appreciated.

Hi Everyone, I am trying to simulate the third-order model of the synchronous generator (figure below). but I have no idea how to do this. Any help would be great.

Hans Scharler
Hans Scharler
最後のアクティビティ: 2021 年 10 月 1 日

Is anyone using the MATLAB Discord channel?
Shogo
Shogo
最後のアクティビティ: 2020 年 8 月 21 日

help

Thank you for your helping. I'm trying to import csv files form a folder, however it does not work.

The following code might be wrong.. fname=mtlb_dir('Users/shogo/Left_Leg_Single-Leg_Landing/SLLExport/*.exp')

I appreciate it if you help,

Sincerely, Shogo

Rik
Rik
最後のアクティビティ: 2024 年 10 月 7 日

Meta threads have a tendency to grow large. This has happened several times before (the wishlist threads #1 #2 #3 #4 #5, and 'What frustrates you about MATLAB?' #1 and #2).
No wonder that a thread from early 2011 has also kept growing. After just under a decade there are (at time of writing) 119 answers, making the page slow to load and navigate (especially on mobile). So after a friendly nudge; here is a new thread for the things that are missing from Matlab.
Same question: are there things you think should be possible in Matlab, but aren't? What things are possible with software packages similar to Matlab that Matlab would benefit from? (note that you can also submit an enhancement request through support, although I suspect they will be monitoring activity on this thread as well)
What should you post where?
Wishlist threads (#1 #2 #3 #4 #5): 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)

This year, the 3-day MATLAB workshop is going Virtual: October 11-13 2020. (Sunday evening - Tuesday afternoon, CST). If you're teaching science, math, engineering or related disciplines, consider signing up now. The application deadline is July 31st. Apply for the workshop: Workshop Application

Details: Name: Teaching Online Computation Using MATLAB (Virtual) Date: October 11-13 2020 (Sunday afternoon -- Tuesday mid-afternoon, US time zones) Location: Zoom session Audience: Educators teaching undergraduate and graduate-level science, math, engineering and related disciplines

At the 2020 virtual workshop, you’ll have opportunities to • Curriculum: Upgrade your curriculum with a focus on transitioning to online learning • Mentoring: Meet in 1-on-1 coaching sessions with faculty, education professionals, and MATLAB experts • Publish and Cite: Get your teaching activities peer reviewed and citable for inclusion in your CV • Community: Collaborate with and build connections to a network of educator peers all working on impactful computational skill development in their courses • Learn: Learn how to embed new MATLAB tools in courses to improve student learning (Note that the workshop will use online technologies to enable 1-on-1 mentoring, group work, and community building. As in past years, the focus will be curriculum development, less presentation.)

In addition, you’ll have the chance to learn how to incorporate MATLAB Live Scripts, MATLAB Online, MATLAB Grader, and more.

This virtual will include working groups for building your curriculum. Participants will be matched with like educators.

Apply now to save your spot and help the conveners plan effective groups.

The workshop hosts will review applications and send acceptances status by early August.

Looking forward to your participation in the workshop, Cathy Manduca, Executive Director, SERC Lisa Kempler, Sponsor, MathWorks Don Baker, McGill University, workshop convener Dan Burleson, University of Houston, workshop convener and review editor Kelly Roos, Bradley University, workshop convener and reviewer Kristi Closser, California State University, Fresno, workshop convener and reviewer

P.S. For reference, 2019 workshop program