主要内容

Results for


Bringing the beauty of MathWorks Natick's tulips to life through code!
Remix challenge: create and share with us your new breeds of MATLAB tulips!
I found this plot of words said by different characters on the US version of The Office sitcom. There's a sparkline for each character from pilot to finale episode.

From Alpha Vantage's website: API Documentation | Alpha Vantage
Try using the built-in Matlab function webread(URL)... for example:
% copy a URL from the examples on the site
URL = 'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=IBM&apikey=demo'
% or use the pattern to create one
tickers = [{'IBM'} {'SPY'} {'DJI'} {'QQQ'}]; i = 1;
URL = ...
['https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&outputsize=full&symbol=', ...
+ tickers{i}, ...
+ '&apikey=***Put Your API Key here***'];
X = webread(URL);
You can access any of the data available on the site as per the Alpha Vantage documentation using these two lines of code but with different designations for the requested data as per the documentation.
It's fun!
isstring
11%
ischar
7%
iscellstr
13%
isletter
21%
isspace
9%
ispunctuation
37%
2455 个投票
Hey MATLAB Community! 🌟
In the vibrant landscape of our online community, the past few weeks have been particularly exciting. We've seen a plethora of contributions that not only enrich our collective knowledge but also foster a spirit of collaboration and innovation. Here are some of the noteworthy contributions from our members.

Interesting Questions

Victor encountered a puzzling error while trying to publish his script to PDF. His post sparked a helpful discussion on troubleshooting this issue, proving invaluable for anyone facing similar challenges.
Devendra's inquiry into interpolating and smoothing NDVI time series using MATLAB has opened up a dialogue on various techniques to manage noisy data, benefiting researchers and enthusiasts in the field of remote sensing.

Popular Discussions

Adam Danz's AMA session has been a treasure trove of insights into the workings behind the MATLAB Answers forum, offering a unique perspective from a staff contributor's viewpoint.
The User Following feature marks a significant enhancement in how community members can stay connected with the contributions of their peers, fostering a more interconnected MATLAB Central.

From File Exchange

Robert Haaring's submission is a standout contribution, providing a sophisticated model for CO2 electrolysis, a topic of great relevance to researchers in environmental technology and chemical engineering.

From the Blogs

Sivylla's comprehensive post delves into the critical stages of AI model development, from implementation to validation, offering invaluable guidance for professionals navigating the complexities of AI verification.
In this engaging Q&A, Ned Gulley introduces us to Zhaoxu Liu, a remarkable community member whose innovative contributions and active engagement have left a significant impact on the MATLAB community.
Each of these contributions highlights the diverse and rich expertise within our community. From solving complex technical issues to introducing new features and sharing in-depth knowledge on specialized topics, our members continue to make MATLAB Central a vibrant and invaluable resource.
Let's continue to support, inspire, and learn from one another


Welcome to MATLAB Central's first Ask Me Anything (AMA) session! Over the next few weeks, I look forward to addressing any questions or curiosities you might have about MATLAB, the forum, sasquatches, or whatever's on your mind. Having volunteered as a contributor to this community before joining MathWorks, I'm excited to act as a bridge between these two worlds. Let's kick things off by sharing a little-known fact about the forum’s staff contributors!
A couple of years ago, before I joined MathWorks as a developer on the Graphics and Charting team, I often wondered who were the MathWorkers with the [staff] moniker answering questions in the Answers forum. Is their MATLAB Central activity part of their day-to-day job expectations? Do they serve specific roles on some kind of community outreach team? Is their work in the forum voluntary in the same way that non-staff contributors volunteer their time?
Now that I'm on the inside, I'd like to share a secret with my fellow MATLAB users and MATLAB Central enthusiasts: with the exception of the MathWorks Support Team, staff participation in the Answers forum is completely voluntary! The staff contributions you see in the forum arise from pure intrinsic motivation to connect with users, help people out of ruts, and spread the word about our product!
For example, Steven Lord has contributed 20-150 answers per month for 9 years! Steven is a quality engineer for core MATLAB numerical functions. Cris LaPierre develops training material and has been a faithful contributor in the forum for almost 6 years! Kojiro Saito and Akira Agata have been tackling Japanese content for more than 7 years! There are many others who have inspired me as a user, and I am honored to now call colleagues: Peter Perkins, Michio, Joss Knight, Alan Weiss, Jiro Doke, Edric Ellis, and many others who deserve appreciation.
The forum's success hinges on the invaluable contributions from the majority of non-staff volunteers, whose dedication and expertise fuel our community. But I know I wasn't alone in wondering about these staff contributors, so now you're in on the secret!
I'm curious to know what other topics you're interested in learning about. Ask me anything!
Temporary print statements are often helpful during debugging but it's easy to forget to remove the statements or sometimes you may not have writing privileges for the file. This tip uses conditional breakpoints to add print statements without ever editing the file!
What are conditional breakpoints?
Conditional breakpoints allow you to write a conditional statement that is executed when the selected line is hit and if the condition returns true, MATLAB pauses at that line. Otherwise, it continues.
The Hack: use ~fprintf() as the condition
fprintf prints information to the command window and returns the size of the message in bytes. The message size will always be greater than 0 which will always evaluate as true when converted to logical. Therefore, by negating an fprintf statement within a conditional breakpoint, the fprintf command will execute, print to the command window, and evalute as false which means the execution will continue uninterupted!
How to set a conditional break point
1. Right click the line number where you want the condition to be evaluated and select "Set Conditional Breakpoint"
2. Enter a valid MATLAB expression that returns a logical scalar value in the editor dialog.
Handy one-liners
Check if a line is reached: Don't forget the negation (~) and the line break (\n)!
~fprintf('Entered callback function\n')
Display the call stack from the break point line: one of my favorites!
~fprintf('%s\n',formattedDisplayText(struct2table(dbstack)))
Inspect variable values: For scalar values,
~fprintf('v = %.5f\n', v)
Use formattedDisplayText to convert more complex data to a string
~fprintf('%s\n', formattedDisplayText(v)).
Make sense of frequent hits: In some situations such as responses to listeners or interactive callbacks, a line can be executed 100s of times per second. Incorporate a timestamp to differentiate messages during rapid execution.
~fprintf('WindowButtonDownFcn - %s\n', datetime('now'))
Closing
This tip not only keeps your code clean but also offers a dynamic way to monitor code execution and variable states without permanent modifications. Interested in digging deeper? @Steve Eddins takes this tip to the next level with his Code Trace for MATLAB tool available on the File Exchange (read more).
Summary animation
To reproduce the events in this animation:
% buttonDownFcnDemo.m
fig = figure();
tcl = tiledlayout(4,4,'TileSpacing','compact');
for i = 1:16
ax = nexttile(tcl);
title(ax,"#"+string(i))
ax.ButtonDownFcn = @axesButtonDownFcn;
xlim(ax,[-1 1])
ylim(ax,[-1,1])
hold(ax,'on')
end
function axesButtonDownFcn(obj,event)
colors = lines(16);
plot(obj,event.IntersectionPoint(1),event.IntersectionPoint(2),...
'ko','MarkerFaceColor',colors(obj.Layout.Tile,:))
end
numel(v)
6%
length(v)
13%
width(v)
14%
nnz(v)
8%
size(v, 1)
27%
sum(v > 0)
31%
2537 个投票
We're thrilled to unveil a new feature in the MATLAB Central community: User Following.
Our community is so lucky to have many experienced MATLAB experts who generously share their knowledge and insights across different applications, including Answers, File Exchange, Discussions, Contests, or Blogs.
With the introduction of User Following feature, you can now easily track new content across different areas and engage in discussions with people you follow. Simply click the ‘Follow’ button located on their profile page to start.
Depending on your communication setting, you will receive notifications via email and/or view updates in your ‘Followed Activity’ feeds. To tailor your feed, select the ‘People’ filter and focus on activities from those you follow.
We strongly encourage you to take advantage of the User Following feature to foster learning and collaboration within our vibrant community.
Who will be the first person you choose to follow? Share your answer in the comments section below and let's inspire each other to explore new horizons together.
ismissing( { [ ] } )
26%
ismissing( NaN )
18%
ismissing( NaT )
11%
ismissing( missing )
21%
ismissing( categorical(missing) )
9%
ismissing( { '' } ) % 2 apostrophes
16%
896 个投票
Mari is helping Dad work.
Today, he got dressed for work to design some new dog toy-making algorithms. #nationalpetday
Transforming my furry friend into a grayscale masterpiece with MATLAB! 🐾 #MATLABPetsDay
This is Stella while waiting to see if the code works...
Hey MATLAB Community! 🌟
As we continue to explore, learn, and innovate together, it's essential to take a moment to recognize the remarkable contributions that have sparked engaging discussions, solved perplexing problems, and shared insightful knowledge in the past two weeks. Let's dive into the highlights that have made our community even more vibrant and resourceful.

Interesting Questions

Burhan Burak brings up an intriguing issue faced when running certain code in MATLAB, seeking advice on how to refactor the code to eliminate a warning message. It's a great example of the practical challenges we often encounter
Jenni asks for guidance on improving linear models to fit data points more accurately. This question highlights the common hurdles in data analysis and model fitting, sparking a conversation on best practices and methodologies.

Popular Discussions

A thought-provoking question posed by goc3 that delves into the intricacies of MATLAB's logical operations. It's a great discussion starter that tests and expands our understanding of MATLAB's behavior.
Toshiaki Takeuchi shares an insightful visualization of the demand for MATLAB jobs across different regions, based on data from LinkedIn. This post not only provides a snapshot of the job market but also encourages members to discuss trends in MATLAB's use in the industry.

From the Blogs

Mike Croucher shares his excitement and insights on two long-awaited features finally making their way into MATLAB R2024a. His post reflects the passion and persistence of our community members in enhancing MATLAB's functionality.
In this informative post, Sivylla Paraskevopoulou offers practical tips for speeding up the training of deep learning models. It's a must-read for anyone looking to optimize their deep learning workflows.
A Heartfelt Thank You 🙏
To everyone who asked a question, started a discussion, or wrote a blog post: Thank you! Your contributions are what make our community a fountain of knowledge, inspiration, and innovation. Let's keep the momentum going and continue to support each other in our journey to explore the vast universe of MATLAB.
Happy Coding!
Note: If you haven't yet, make sure to check out these highlights and add your voice to our growing community. Your insights and experiences are what make us stronger.