メインコンテンツ

結果:


Adam Danz
Adam Danz
最後のアクティビティ: 2021 年 5 月 24 日

Did you know you can use most emoticons in text objects?

Most emoticons are just unicode characters. Using them as characters in Matlab is as simple as finding their numeric representation and then converting the numeric value back to character. Not all emoticons are convertible in Matlab.

Here's a secret message with emoticons. Use char(x) to decode it.

x = [79 77 71 33 32 55357 56878 32 104 97 118 101 32 121 111 ...
    117 32 117 112 100 97 116 101 100 32 116 111 32 77 97 116 ...
    108 97 98 32 55358 56595 32 114 50 48 50 49 97 32 121 101 116 32 8265];

Happy St. Patrick's Day!

fig = figure('MenuBar','none','Color', [0 .62 .376]);  % Shamrock green
ax = axes(fig,'Units','Normalized','Position',[0 0 1 1]);
axis(ax,'off')
axis(ax,'equal')
hold(ax,'on')
xlim(ax,[-1,1]); ylim(ax,[-1,1])
text(ax, 0, 0, char(9752), 'VerticalAlignment','middle','HorizontalAlignment','center','FontSize', 200)
str = num2cell('Happy St Patrick''s day!');
th = linspace(-pi/2,pi/2,numel(str)); 
txtHandle = text(ax,sin(th)*.8, cos(th)*.8, str, 'VerticalAlignment','middle','HorizontalAlignment','center','FontSize', 25);
set(txtHandle,{'rotation'}, num2cell(rad2deg(-th')))
thr = 0.017;
rotateCCW = @(xyz)([cos(thr) -sin(thr) 0; sin(thr), cos(thr), 0; 0 0 1]*xyz.').';
while all(isvalid(txtHandle))
    newposition = rotateCCW(vertcat(txtHandle.Position)); 
    set(txtHandle,{'position'}, mat2cell(newposition,ones(numel(txtHandle),1),3), ...
        {'rotation'}, num2cell([txtHandle.Rotation].'+thr*180/pi))
    drawnow()
end
Adam Danz
Adam Danz
最後のアクティビティ: 2023 年 1 月 15 日

We've all been there. You've got some kind of output that displays perfectly in the command window and you just want to capture that display as a string so you can use it again somewhere else. Maybe it's a multidimensional array, a table, a structure, or a fit object that perfectly displays the information you need in a neat and tidy format but when you try to recreate the display in a string variable it's like reconstructing the Taj Mahal out of legos.

Enter Matlab r2021a > formattedDisplayText()

Use str=formattedDisplayText(var) the same way you use disp(var) except instead of displaying the output, it's stored as a string as it would appear in the command window.

Additional name-value pairs allow you to

  • Specify a numeric format
  • Specify loose|compact line spacing
  • Display true|false instead of 1|0 for logical values
  • Include or suppress markup formatting that may appear in the display such as the bold headers in tables.

Demo: Record the input table and results of a polynomial curve fit

load census
[fitobj, gof] = fit(cdate, pop, 'poly3', 'normalize', 'on')

Results printed to the command window:

fitobj = 
     Linear model Poly3:
     fitobj(x) = p1*x^3 + p2*x^2 + p3*x + p4
       where x is normalized by mean 1890 and std 62.05
     Coefficients (with 95% confidence bounds):
       p1 =       0.921  (-0.9743, 2.816)
       p2 =       25.18  (23.57, 26.79)
       p3 =       73.86  (70.33, 77.39)
       p4 =       61.74  (59.69, 63.8)
gof = 
  struct with fields:
             sse: 149.77
         rsquare: 0.99879
             dfe: 17
      adjrsquare: 0.99857
            rmse: 2.9682

Capture the input table, the printed fit object, and goodness-of-fit structure as strings:

rawDataStr = formattedDisplayText(table(cdate,pop),'SuppressMarkup',true)
fitStr = formattedDisplayText(fitobj)
gofStr = formattedDisplayText(gof)

Display the strings:

rawDataStr = 
    "    cdate     pop 
         _____    _____
         1790       3.9
         1800       5.3
         1810       7.2
         1820       9.6
         1830      12.9
         1840      17.1
         1850      23.1
         1860      31.4
         1870      38.6
         1880      50.2
         1890      62.9
         1900        76
         1910        92
         1920     105.7
         1930     122.8
         1940     131.7
         1950     150.7
         1960       179
         1970       205
         1980     226.5
         1990     248.7
     "
fitStr = 
    "     Linear model Poly3:
          ary(x) = p1*x^3 + p2*x^2 + p3*x + p4
            where x is normalized by mean 1890 and std 62.05
          Coefficients (with 95% confidence bounds):
            p1 =       0.921  (-0.9743, 2.816)
            p2 =       25.18  (23.57, 26.79)
            p3 =       73.86  (70.33, 77.39)
            p4 =       61.74  (59.69, 63.8)
     "
gofStr = 
    "           sse: 149.77
            rsquare: 0.99879
                dfe: 17
         adjrsquare: 0.99857
               rmse: 2.9682
     "

Combine the strings into a single string and write it to a text file in your temp directory:

txt =  strjoin([rawDataStr; fitStr; gofStr],[newline newline]);
file = fullfile(tempdir,'results.txt');
fid = fopen(file,'w+');
cleanup = onCleanup(@()fclose(fid)); 
fprintf(fid, '%s', txt);
clear cleanup

Open results.txt.

winopen(file) % for Windows platforms
PB75
PB75
最後のアクティビティ: 2021 年 3 月 15 日

Hi All,

Quick question regarding deriving PM flux linkage [Wb] from a torque constant estimated from data on a PMLSM.

I have an estimated torque constant Kt [N/A], which is from experimental test data. I will now parameterising my Simscape PMLSM block from this torque constant.

The literature seems confusing, to derive PM flux linkage [Wb] from the experimental torque contant do i include the (3/2) constant. Some examples include the constant and some omit, which one of the following is preferred for deriving the PM flux linkage?

Thanks

Patrick

Hi, MathWorks / MATLAB / Simulink community! I have recently started working my way through the book mentioned in the topic, and I am wondering if anybody out there would be interested and have time to help me review some of my work on the exercises. Specifically, I'm currently working "Exercise 7.9 - Challenge: Design of a Type 2 PLL" and I am not convinced that my implementation is correct, but I'm having some trouble with debugging.

Is anyone interested and have time to review my implementation and give some feedback? I'd definitely appreciate it.

Thanks!

Shaun Lippy Middleburg, VA, USA

ASME will be hosting a four-part conversation series from March 22-25, that will educate and equip mechanical engineers with workforce strategies. The series will bring together leaders and industry experts in education to explore which new skills will be taught to young engineers, what training mid-career engineers need in order to return to work as the pandemic subsides, and how much more can be done to confront the labor and skills gap in 2021 and beyond.

I was honored to be asked to participate in the first panel discussion along with distinguished faculty from MIT and the University of Colorado Boulder. I would encourage all of our customers involved in online teaching and learning to attend. More details on the panel discussion that features MathWorks response to COVID-19 are below:

The Evolution of Engineering Education Post-COVID-19 (March 22): The transition to remote learning was a shock for many universities and colleges across the country. Professors had to transform their in-person lecture into an engaging online class, and students had to take on more self-learning responsibilities. What impact will this change in teaching have on the future of education? This conversation will focus on the shift to online education at universities, the digital engineering skills students will need to learn, and how academia and industry can work together to prepare the young engineers entering the workforce.

The Evolution of Engineering Education Post-COVID-19 : https://app.webinar.net/vlOW9kK90wm?mcc=EDIT

Brian Puozaa
Brian Puozaa
最後のアクティビティ: 2021 年 3 月 2 日

I just started my MPhil in power systems and we are doing load flow analysis. I am completely lost throughout the gauss seidel and newton Raphson methods using MatLab. can I get help, please?

This is a great presentation from 2 professors introducing how they use MATLAB in their physics courses. MATLAB Grader and Live Scripts are discussed in detail.

YouTube Video

Here is the abstract:

-----

Guest Presenters: Michele McColgan, Siena College and Duncan Carlsmith, UW Madison

The meeting will start with short presentations, and then we'll have time for questions and discussion in a colloquial setting. The presenters use MATLAB in their courses, and this meeting will provide a good opportunity to see the functionality that MATLAB affords. However, the presenters' approach to integrating computation is relevant generally; thus, this meeting should be of great interest, even if you are not a MATLAB user.

-----

Webinar from PICUP .

Prof. Duarte Antunes from Eindhoven University of Technology explains how he's been using MATLAB live scripts for teaching an online "Optimal Control and Dynamic Programming" course.

https://www.mathworks.com/company/newsletters/articles/using-matlab-live-scripts-to-teach-optimal-control-and-dynamic-programming-online.html

Daniel Dolan
Daniel Dolan
最後のアクティビティ: 2024 年 8 月 7 日

Is anyone else disappointed with uifigures? It seems apparent that these will eventually replace traditional figures, but there is still so much that doesn't quite work. I've tinkered with uifigures since their introduction in release 2016a, but even in 2020a I can't reliably export a uifigure to a graphics file. Sure it works sometimes, but not if a uipanel is present. The exportgraphics command is not as powerful as the print command, leaving some graphic formats (such as *.svg and *.eps) unsupported. How do you generate graphic files of a specific size? You can't even use subplots without overriding the default AutoResizeChildren setting!
Everything with uifigures seems to be slower and less stable than the figure variant. App Designer is much better than GUIDE, but that is not exactly high praise. I would rather generate "apps" programatically across several files instead of dealing with a single-file class definition containing 1000+ lines.
Where is this transition going? MATLAB graphics are moving away from Java in favor of JavaScript, and I'm not sure that we are at all ready for that.
Jiro Doke
Jiro Doke
最後のアクティビティ: 2021 年 2 月 5 日

WiDS Datathon 2021 is going on right now. The focus of the Datathon this year is "on creating models to classify whether patients have been diagnosed with a certain type of diabetes." You can register and participate until March 1.

Also, take a look at this blog post on the MATLAB benchmark code for this datathon.

MATLAB Benchmark Code for WiDS Datathon 2021

There are also various online challenges by MathWorks that students may be interested. Here are the winners from last year's Simulink Student Challenge. There was also a MATLAB Online Live Editor Challenge a couple of years ago.

Emrah Duatepe
Emrah Duatepe
最後のアクティビティ: 2023 年 1 月 23 日

Hello , I wonder how to determine continous or discrete time modelling.For example if I want to run my model in MCU in this case discrete model is suitable?I am a bit confused

David
David
最後のアクティビティ: 2021 年 2 月 23 日

MATLAB Answers will now properly handle the use of the '*@*' character when you want to get someone's attention. This behavior is commonly referred to as 'mentioning' or 'tagging' someone and is a feature found in most communication apps.

Why we are doing this

To help with communication and potentially speed up conversations. Also, it turns out many of you have been typing the @ character in Answers already, even though the MATLAB Answers site didn't behave in the expected way.

How it works

Once you type the @ character a popup will appear listing the community members already in the Q/A thread, as you keep typing the list will expand to include members not in the thread. A mentioned user will receive a notification when the question/answer/comment is posted. Each mention in the Q/A thread will have a new visual style and link to the user profile for that community member.

If you don't want to get 'mentioned' you can turn off the setting in your communication preferences located on your profile page .

We hope you will find this feature helpful and as always please reply with any feedback you may have.

David
David
最後のアクティビティ: 2021 年 3 月 12 日

We have created a new community for users of ThingSpeak. This new community is for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.

Christopher Stapels will be moderating the new ThingSpeak community .

We encourage you to visit the new community and share best practices, examples, and ask questions.

Tony Lennon
Tony Lennon
最後のアクティビティ: 2021 年 1 月 8 日

MathWorks is please to offer a new training course, Power Electronics Control Design with Simulink and Simscape.

This one-day course focuses on modeling and controlling power electronic systems in the Simulink® environment using Simscape Electrical™. Topics include:

  • Modeling direct current (dc) power electronic components
  • Controlling the level of fidelity in a model
  • Developing controls for power electronics
  • Modeling three-phase alternating current (ac) power electronic components
  • Controlling power electronics for motor drive applications
David
David
最後のアクティビティ: 2021 年 1 月 21 日

Ameer Hamza had a great 2020 and has been awarded the coveted MOST ACCEPTED answers badge for all his contributions in MATLAB Answers this past year. Ameer joins Walter Roberson and Image Analyst in receiving this award going all the way back to 2012!

There are 10 community members who have achieved the Top Downloads badge for their popular File Exchange submissions in 2020. Do you recognize any of these names? There's a good chance you've used one or more of their toolboxes or scripts in your work if you're a frequent visitor to File Exchange, if you're not you might want to check out what they've posted, it may save you a lot of time writing your own code.

--------------------- Top Downloads Badge Winners -----------------

Congratulations to all these winners and a giant THANK YOU for all they've done this past year to help everyone in the MATLAB Central community!

Joe Whitley
Joe Whitley
最後のアクティビティ: 2021 年 2 月 5 日

Hi everyone,

I am a third year BEng Energy Engineering student. I am looking at the design, modelling and peformance of an HVDC power converter for use in offshore wind for my final year dissertation. Power electronics is a new area for me and I am also new to simulink/ simscape elctrical.

Could anyone provide some useful examples of MMC (in particular rectifiers), or some advice for designing in simscape electrical. I am struggling with the design of PWM control especially. I aim to make a scaled down version of the MMC in Simulink but so far have had no luck. If anyone can help I would be really appreciative.

Thanks in advance.

Joe

Venia
Venia
最後のアクティビティ: 2020 年 12 月 1 日

Hi everybody!I've realized a DC/DC Buck Converter Model with closed loop control system. I need to limit the overshoot in the step response of the submitted system. I've already tried to tune the controller in the PID Tuner by manually adjusting the overshoot by moving the response time slider, as it is said in this article: https://it.mathworks.com/help/slcontrol/gs/automated-tuning-of-simulink-pid-controller-block.html The problem is that it is not accurate. I manage to get an overshoot of 4.77% or 5.4%, whereas i need to set the parameters in order that the overshoot is 5%. Should I use TuningGoal.Overshoot? How am I supposed to do? How should I set the input and output in my model? I've read Matlab documentation but I didn't catch that. Thanks in advance!

dinelly mesa
dinelly mesa
最後のアクティビティ: 2020 年 11 月 27 日

I am currently working on simulink online but I cannot maximize the screen

Jiro Doke
Jiro Doke
最後のアクティビティ: 2020 年 12 月 31 日

Just making sure people are aware of our new Onramp courses. These are great self-learning resources for students.

Released a few months ago:

Released this month: