Pull up a chair!

Discussions is your place to get to know your peers, tackle the bigger challenges together, and have fun along the way.

• Looking for techniques improve your MATLAB or Simulink skills? Tips & Tricks has you covered!
• Sharing the perfect math joke, pun, or meme? Look no further than Fun!
• Think there's a channel we need? Tell us more in Ideas

# Updated Discussions

Image Analyst
Last activity 大约 6 小时 前

### What is your main/preferred programming language of choice?

MATLAB (Way to go!!! You rock!)
49%
Python (not from within MATLAB)
29%
Any variation of C
12%
Java, Javascript
4%
R, Ruby, Swift, Go, Scala, PHP, VB
2%
Other not mentioned, or mixture
4%
10577 个投票
David
Last activity 2024-5-20，13:51

### Pick of the week - 1/31/20

Check out barChartRace by Eiji Konaka , this weeks pick by Jiro.
goc3
Last activity 2024-5-20，11:58

### How many code files are typically in your MATLAB Projects (scripts, functions, classes, tests)?

Last activity 2024-5-18，20:40

### Which color format are you least familiar or least comfortable with?

lazymatlab
Last activity 2024-5-18，1:13

### Helped a high school student for a physics problem with this.

A high school student called for help with this physics problem:
• Car A moves with constant velocity v.
• Car B starts to move when Car A passes through the point P.
• Car B undergoes...
• uniform acc. motion from P to Q.
• uniform velocity motion from Q to R.
• uniform acc. motion from R to S.
• Car A and B pass through the point R simultaneously.
• Car A and B arrive at the point S simultaneously.
Q1. When car A passes the point Q, which is moving faster?
Q2. Solve the time duration for car B to move from P to Q using L and v.
Q3. Magnitude of acc. of car B from P to Q, and from R to S: which is bigger?
Code below:
%% get images and prepare stuffs
figure(WindowStyle="docked"),
ax1 = subplot(2,1,1);
hold on, box on
ax1.XTick = [];
ax1.YTick = [];
A = plot(0, 1, 'ro', MarkerSize=10, MarkerFaceColor='r');
B = plot(0, 0, 'bo', MarkerSize=10, MarkerFaceColor='b');
carA = imrotate(imresize(carA, 0.1), -90);
carB = imrotate(imresize(carB, 0.1), 180);
alphaA = imrotate(imresize(alphaA, 0.1), -90);
alphaB = imrotate(imresize(alphaB, 0.1), 180);
carA = imagesc(carA, AlphaData=alphaA, XData=[-0.1, 0.1], YData=[0.9, 1.1]);
carB = imagesc(carB, AlphaData=alphaB, XData=[-0.1, 0.1], YData=[-0.1, 0.1]);
txtA = text(0, 0.85, 'A', FontSize=12);
txtB = text(0, 0.17, 'B', FontSize=12);
yline(1, 'r--')
yline(0, 'b--')
xline(1, 'k--')
xline(2, 'k--')
text(1, -0.2, 'Q', FontSize=20, HorizontalAlignment='center')
text(2, -0.2, 'R', FontSize=20, HorizontalAlignment='center')
% legend('A', 'B') % this make the animation slow. why?
xlim([0, 3])
ylim([-.3, 1.3])
%% axes2: plots velocity graph
ax2 = subplot(2,1,2);
box on, hold on
xlabel('t'), ylabel('v')
vA = plot(0, 1, 'r.-');
vB = plot(0, 0, 'b.-');
xline(1, 'k--')
xline(2, 'k--')
xlim([0, 3])
ylim([-.3, 1.8])
p1 = patch([0, 0, 0, 0], [0, 1, 1, 0], [248, 209, 188]/255, ...
EdgeColor = 'none', ...
FaceAlpha = 0.3);
%% solution
v = 1; % car A moves with constant speed.
L = 1; % distances of P-Q, Q-R, R-S
% acc. of car B for three intervals
a(1) = 9*v^2/8/L;
a(2) = 0;
a(3) = -1;
t_BatQ = sqrt(2*L/a(1)); % time when car B arrives at Q
v_B2 = a(1) * t_BatQ; % speed of car B between Q-R
%% patches for velocity graph
p2 = patch([t_BatQ, t_BatQ, t_BatQ, t_BatQ], [1, 1, v_B2, v_B2], ...
[248, 209, 188]/255, ...
EdgeColor = 'none', ...
FaceAlpha = 0.3);
p3 = patch([2, 2, 2, 2], [1, v_B2, v_B2, 1], [194, 234, 179]/255, ...
EdgeColor = 'none', ...
FaceAlpha = 0.3);
%% animation
tt = linspace(0, 3, 2000);
for t = tt
A.XData = v * t;
vA.XData = [vA.XData, t];
vA.YData = [vA.YData, 1];
if t < t_BatQ
B.XData = 1/2 * a(1) * t^2;
vB.XData = [vB.XData, t];
vB.YData = [vB.YData, a(1) * t];
p1.XData = [0, t, t, 0];
p1.YData = [0, vB.YData(end), 1, 1];
elseif t >= t_BatQ && t < 2
B.XData = L + (t - t_BatQ) * v_B2;
vB.XData = [vB.XData, t];
vB.YData = [vB.YData, v_B2];
p2.XData = [t_BatQ, t, t, t_BatQ];
p2.YData = [1, 1, vB.YData(end), vB.YData(end)];
else
B.XData = 2*L + v_B2 * (t - 2) + 1/2 * a(3) * (t-2)^2;
vB.XData = [vB.XData, t];
vB.YData = [vB.YData, v_B2 + a(3) * (t - 2)];
p3.XData = [2, t, t, 2];
p3.YData = [1, 1, vB.YData(end), v_B2];
end
txtA.Position(1) = A.XData(end);
txtB.Position(1) = B.XData(end);
carA.XData = A.XData(end) + [-.1, .1];
carB.XData = B.XData(end) + [-.1, .1];
drawnow
end
Image Analyst
Last activity 2024-5-17，18:07

### Puzzle challenge - distance to horizon

In one line of MATLAB code, compute how far you can see at the seashore. In otherwords, how far away is the horizon from your eyes? You can assume you know your height and the diameter or radius of the earth.
Last activity 2024-5-17，18:05

### Today, while using MATLAB, I'm going to....

Hans Scharler
Last activity 2024-5-17，17:56

### The Office Words Spoken by Episode

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.
goc3
Last activity 2024-5-17，17:23

### Which of the following is not a built-in string-checking function?

Mike
Last activity 2024-5-16，18:49

### Research ethics using generative A.I

Dear members, I’m currently doing research on the subject of using Generative A.I. as a digital designer. What our research group would like to know is which ethical issues have a big impact on the decisions you guys and girls make using generative A.I.
Are you currently using A.I. when doing your job? Yes, what for. No (not yet), why not?
Using A.I., would you use real information or alter names/numbers to get an answer?
What information would or wouldn’t you use? If the client is asking/ordering you to do certain things that go against your principles, would you still do it because order is order? How far would you go?
Who is responsible for the outcome of the generated content, you or the client?
Would you still feel like a product owner if it was co-developed with A.I.?
What we are looking for is that we would like to know why people do or don’t use AI in the field of design and wich ethical considerations they make. We’re just looking for general moral line of people, for example: 70% of designers don’t feel owner of a design that is generated by AI but 95% feels owner when it is co-created.
Mathew
Last activity 2024-5-16，16:21

is there any sites available online free ai course learning except: coursera.org
Last activity 2024-5-15，18:24

### Simulink and App Designer integration in R2024a

Are you a Simulink user eager to learn how to create apps with App Designer? Or an App Designer enthusiast looking to dive into Simulink?
Don't miss today's article on the Graphics and App Building Blog by @Robert Philbrick! Discover how to build Simulink Apps with App Designer, streamlining control of your simulations!
Chen Lin
Last activity 2024-5-15，17:38

### Introducing the User Following Feature on MATLAB Central

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.
goc3
Last activity 2024-5-14，13:13

### Which of the following does not return the correct length (5) of v = [6,2,9,7,3]?

Zhaoxu Liu / slandarer
Last activity 2024-5-13，20:02

This cheat sheet is here:
reference:
MATLAB used to have official visualization-cheat-sheet, but there have been quite a few new updates in MATLAB versions recently. Therefore, I made my own cheat sheet and marked the versions of each new thing that were released :
Chen Lin
Last activity 2024-5-13，19:58

### Northern Lights

Northern lights captured from this weekend at MathWorks campus ✨
Did you get a chance to see lights and take some photos?
Robert
Last activity 2024-5-13，18:20

### Alpha Vantage: Easy tutorial on how to get data into Matlab from Alpha Vantage

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 = ...
+ tickers{i}, ...
+ '&apikey=***Put Your API Key here***'];
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!
Daniele Lupo
Last activity 2024-5-12，10:32

### Which toolboxes for crypto trading?

Hi to all.
I'm trying to learn a bit about trading with cryptovalues. At the moment I'm using Freqtrade (in dry-run mode of course) for automatic trading. The tool is written in python and it allows to create custom strategies in python classes and then run them.
I've written some strategy just to learn how to do, but now I'd like to create some interesting algorithm. I've a matlab license, and I'd like to know what are suggested tollboxes for following work:
• Create a criptocurrency strategy algorythm (for buying and selling some crypto like BTC, ETH etc).
• Backtesting the strategy with historical data (I've a bunch of json files with different timeframes, downloaded with freqtrade from binance).
• Optimize the strategy given some parameters (they can be numeric, like ROI, some kind of enumeration, like "selltype" and so on).
• Convert the strategy algorithm in python, so I can use it with Freqtrade without worrying of manually copying formulas and parameters that's error prone.
• I'd like to write both classic algorithm and some deep neural one, that try to find best strategy with little neural network (they should run on my pc with 32gb of ram and a 3080RTX if it can be gpu accelerated).
What do you suggest?
Hans Scharler
Last activity 2024-5-10，8:02

### What's everyone doing today?

Chen, Rena, and I are at a community management event. It's great to be with others talking about relationships, trust, and co-creation.
Mike Croucher
Last activity 2024-5-10，7:06