主要内容

搜索


Joseff Bailey-Wood
Joseff Bailey-Wood
上次活动时间: 10 分钟 前

Hi! I'm Joseff and along with being a student in chemical engineering, one of my great passions is language-learning. I learnt something really cool recently about Catalan (a romance language closely related to Valencian that's spoken in Andorra, Catalonia, and parts of Spain) — and that is how speakers tell the time.
While most European languages stick to the standard minutes-past / minutes-to between hours, Catalan does something really quite special, with a focus on the quarters (quarts [ˈkwarts]). To see what I mean, take a look at this clock made by Penguin___Lover on Instructables :
If you want to tell the time in Catalan, you should refer to the following hour (the one that's still to come), and how many minutes have passed or will pass for the closest quarter (sometimes half-quarter / mig quart [ˈmit͡ʃ kwart]) — clear as mud? It's definitely one of the more difficult things to wrap your head around as a learner. But fear not, with the power of MATLAB, we'll you'll understand in no time!
To make a tool to tell the time in Catalan, the first thing we need to do is extract the current time into its individual hours, minutes and seconds*
function catalanTime = quinahora()
% Get the current time
[hours, minutes, seconds] = hms(datetime("now"));
% Adjust hours to 12-hour format
catalanHour = mod(hours-1, 12)+1;
nextHour = mod(hours, 12)+1;
Then to defining the numbers in catalan. It's worth noting that because the hours are feminine and the minutes are masculine, the words for 1 and 2 is different too (this is not too weird as languages go, in fact for my native Welsh there's a similar pattern between 2 and 4).
% Define the numbers in Catalan
catNumbers.masc = ["un", "dos", "tres", "quatre", "cinc"];
catNumbers.fem = ["una", "dues", "tres", "quatre",...
"cinc", "sis", "set", "vuit",...
"nou", "deu", "onze", "dotze"];
Okay, now it's starting to get serious! I mentioned before that this traditional time telling system is centred around the quarters — and that is true, but you'll also hear about the mig de quart (half of a quarter) * which is why we needed that seconds' precision from earlier!
% Define 07:30 intervals around the clock from 0 to 60
timeMarks = 0:15/2:60;
timeFraction = minutes + seconds / 60; % get the current position
[~, idx] = min(abs(timeFraction - timeMarks)); % extract the closest timeMark
mins = round(timeFraction - timeMarks(idx)); % round to the minute
After getting the fraction of the hour that we'll use later to tell the time, we can look into how many minutes it differs from that set time, using menys (less than) and i (on top of). There's also a bit of an AM/PM distinction, so you can use this function and know whether it's morning or night!
% Determine the minute string (diffString logic)
diffString = '';
if mins < 0
diffString = sprintf(' menys %s', catNumbers.masc(abs(mins)));
elseif mins > 0
diffString = sprintf(' i %s', catNumbers.masc(abs(mins)));
end
% Determine the part of the day (partofDay logic)
if hours < 12
partofDay = 'del matí'; % Morning (matí)
elseif hours < 18
partofDay = 'de la tarda'; % Afternoon (tarda)
elseif hours < 21
partofDay = 'del vespre'; % Evening (vespre)
else
partofDay = 'de la nit'; % Night (nit)
end
% Determine 'en punt' (o'clock exactly) based on minutes
enPunt = '';
if mins == 0
enPunt = ' en punt';
end
Now all that's left to do is define the main part of the string, which is which mig quart we are in. Since we extracted the index idx earlier as the closest timeMark, it's just a matter of indexing into this after the strings have been defined.
% Create the time labels
labels = {sprintf('són les %s%s%s %s', catNumbers.fem(catalanHour), diffString, enPunt, partofDay), ...
sprintf('és mig quart de %s%s %s', catNumbers.fem(nextHour), diffString, partofDay), ...
sprintf('és un quart de %s%s %s', catNumbers.fem(nextHour), diffString, partofDay), ...
sprintf('és un quart i mig de %s%s %s', catNumbers.fem(nextHour), diffString, partofDay), ...
sprintf('són dos quarts de %s%s %s', catNumbers.fem(nextHour), diffString, partofDay), ...
sprintf('són dos quarts i mig de %s%s %s', catNumbers.fem(nextHour), diffString, partofDay), ...
sprintf('són tres quarts de %s%s %s', catNumbers.fem(nextHour), diffString, partofDay), ...
sprintf('són tres quarts i mig de %s%s %s', catNumbers.fem(nextHour), diffString, partofDay), ...
sprintf('són les %s%s%s %s', catNumbers.fem(nextHour), diffString, enPunt, partofDay)};
catalanTime = labels{idx};
Then we need to do some clean up — the definite article les / la and the preposition de don't play nice with un and the initial vowel in onze, so there's a little replacement look here.
% List of old and new substrings for replacement
oldStrings = {'les un', 'són la una', 'de un', 'de onze'};
newStrings = {'la una', 'és la una', 'd''una', 'd''onze'};
% Apply replacements using a loop
for i = 1:length(oldStrings)
catalanTime = strrep(catalanTime, oldStrings{i}, newStrings{i});
end
end
quinahora()
ans = 'és un quart i mig de nou menys tres del vespre'
So, can you work out what time it was when I made this post? 🤔
And how do you tell the time in your language?
Fins després!

Bonsoir

Je me permets de vous contacter afin d’obtenir des informations et un encadrement concernant un projet sur lequel je travaille actuellement. Il s’agit d’une application visant à réguler un oscillateur quantique en potentiel harmonique à l’aide de l’intelligence artificielle.

Plus précisément, mon objectif est de :

Modéliser l’évolution de l’oscillateur quantique sous un potentiel harmonique.

Appliquer des techniques d’IA (réseaux de neurones, renforcement, etc.) pour optimiser la régulation de son état.

Analyser les performances des algorithmes dans le cadre de cette régulation.

Je souhaiterais savoir si vous pourriez m’apporter des conseils ou un encadrement dans la réalisation de ce projet, notamment sur les aspects mathématiques, physiques et computationnels impliqués. De plus, toute suggestion sur des références bibliographiques ou des outils adaptés (MATLAB, Python, TensorFlow, etc.) serait également très précieuse.

Dans l’attente de votre retour, Bien cordialement,

📢 We want to hear from you! We're a team of graduate student researchers at the University of Michigan studying MATLAB Drive and other cloud-based systems for sharing coding files. Your feedback will help improve these tools. Take our quick survey here: https://forms.gle/DnHs4XNAwBZvmrAw6

Imagine you are developing a new toolbox for MATLAB. You have a folder full of a few .m files defining a bunch of functions and you are thinking 'This would be useful for others, I'm going to make it available to the world'
What process would you go through? What's the first thing you'd do?
I have my own opinions but don't want to pollute the start of the conversation :)
Steve Eddins
Steve Eddins
上次活动时间: 2025-3-11,12:39

Over the last 5 years or so, the highest-traffic post on my MATLAB Central image processing blog was not actually about image processing; it was about changing the default line thickness in plots.
Now I have written about some other MATLAB plotting behavior that I have recently changed to suit my own preferences. See this new blog post.
Here is a standard MATLAB plot:
x = 0:pi/100:2*pi;
y1 = sin(x);
y2 = cos(x);
plot(x,y1,x,y2)
I don't like some aspects of this plot, and so I have put the following code into my startup file.
set(groot,"DefaultLineLineWidth",2)
set(groot,"DefaultAxesXLimitMethod","padded")
set(groot,"DefaultAxesYLimitMethod","padded")
set(groot,"DefaultAxesZLimitMethod","padded")
set(groot,"DefaultAxesXGrid","on")
set(groot,"DefaultAxesYGrid","on")
set(groot,"DefaultAxesZGrid","on")
With those defaults changed, here is my preferred appearance:
plot(x,y1,x,y2)
To develop uifigure-based app, I wish MATLAB can provide something like uiquestdlg to replace questdlg without changing too much of the original code developed for figure-based app. Also, uiinputdlg <-> inputdlg and so on.
It is time to support the cameraIntrinsics function to accept a 3-by-3 intrinsic matrix K as an input parameter for constructing the object. Currently, the built-in cameraIntrinsics function can only be constructed by explicitly specifying focalLength, principalPoint, and imageSize. This approach has drawbacks, as it is not very intuitive. In most application scenarios, using the intrinsic matrix
K=[fx,0,cx;
0,fy,cy;
0,0,1]
is much more straightforward and effective!
intrinsics = cameraIntrinsics(K)
Learn the basic of quantum computing, how to simulate quantum circuits on MATLAB and how to run them on real quantum computers using Amazon Braket. There will also be a demonstration of machine learning using quantum computers!
Details at MATLAB-AMAZON Braket Hands-on Quantum Machine Learning Workshop - MATLAB & Simulink. This will be led by MathWorker Hossein Jooya.
I kicked off my own exploration of Quantum Computing in MATLAB a year or so ago and wrote it up on The MATLAB Blog: Quantum computing in MATLAB R2023b: On the desktop and in the cloud » The MATLAB Blog - MATLAB & Simulink. This made use of the MATLAB Support Package for Quantum Computing - File Exchange - MATLAB Central
Tawanda
Tawanda
上次活动时间: 2025-3-2,14:05

Good day I am looking someone to help me on the matlab and simulink I am missing some explanations.For easy communication you can contact 0026876637042
Recently my iMac became sluggish. I checked Activity Monitor and found it was spending most of its time in mds_stores. I turned of Apple Intelligence under System Settings - Apple Intelligence & Siri, and its like new again.
Do you boast about the energy savings you racking up by using dark mode while stashing your energy bill savings away for an exotic vacation🌴🥥? Well, hold onto your sun hats and flipflops!
A recent study presented at the 1st Internaltional Workshop on Low Carbon Computing suggests that you may be burning more ⚡energy⚡ with your slick dark displays 💻[1].
In a 2x2 factorial design, ten participants viewed a webpage in dark and light modes in both dim and lit settings using an LCD monitor with 16 brightness levels.
  • 80% of participants increased the monitor's brightness in dark mode [2]
  • This occurred in both lit and dim rooms
  • Dark mode did not reduce power draw but increasing monitor brightness did.
The color pixels in an LCD monitor still draw voltage when the screen is black, which is why the monitor looks gray when displaying a pure black background in a dark room. OLED monitors, on the other hand, are capable of turning off pixels that represent pure black and therefore have the potential to save energy with dark mode. A 2021 Purdue study estimates a 3%-9% energy savings with dark mode on OLED monitors using auto-brightness [3]. However, outside of gaming, OLED monitors have a very small market share and still account for less than 25% within the gaming world.
Any MATLAB users out there with OLED monitors? How are you going to spend your mad cash savings when you start using MATLAB's upcoming dark theme?
  1. BBC study: https://www.sicsa.ac.uk/wp-content/uploads/2024/11/LOCO2024_paper_12.pdf
  2. BBC blog article https://www.bbc.co.uk/rd/articles/2025-01-sustainability-web-energy-consumption
  3. 2021 Purdue https://dl.acm.org/doi/abs/10.1145/3458864.3467682
Mike Croucher
Mike Croucher
上次活动时间: 2025-2-24,22:04

tiledlayout(4,1);
% Plot "L" (y = 1/(x+1), for x > -1)
x = linspace(-0.9, 2, 100); % Avoid x = -1 (undefined)
y =1 ./ (x+1) ;
nexttile;
plot(x, y, 'r', 'LineWidth', 2);
xlim([-10,10])
% Plot "O" (x^2 + y^2 = 9)
theta = linspace(0, 2*pi, 100);
x = 3 * cos(theta);
y = 3 * sin(theta);
nexttile;
plot(x, y, 'r', 'LineWidth', 2);
axis equal;
% Plot "V" (y = -2|x|)
x = linspace(-1, 1, 100);
y = 2 * abs(x);
nexttile;
plot(x, y, 'r', 'LineWidth', 2);
axis equal;
% Plot "E" (x = -3 |sin(y)|)
y = linspace(-pi, pi, 100);
x = -3 * abs(sin(y));
nexttile;
plot(x, y, 'r', 'LineWidth', 2);
axis equal;
I've been trying this problem a lot of time and i don't understand why my solution doesnt't work.
In 4 tests i get the error Assertion failed but when i run the code myself i get the diag and antidiag correctly.
function [diag_elements, antidg_elements] = your_fcn_name(x)
[m, n] = size(x);
% Inicializar los vectores de la diagonal y la anti-diagonal
diag_elements = zeros(1, min(m, n));
antidg_elements = zeros(1, min(m, n));
% Extraer los elementos de la diagonal
for i = 1:min(m, n)
diag_elements(i) = x(i, i);
end
% Extraer los elementos de la anti-diagonal
for i = 1:min(m, n)
antidg_elements(i) = x(m-i+1, i);
end
end
On 27th February María Elena Gavilán Alfonso and I will be giving an online seminar that has been a while in the making. We'll be covering MATLAB with Jupyter, Visual Studio Code, Python, Git and GitHub, how to make your MATLAB projects available to the world (no installation required!) and much much more.
Of course
62.5%
I never tried
37.5%
16 个投票
Check out the result of "emoji matrix" multiplication below.
  • vector multiply vector:
a = ["😁","😁","😁"]
Warning: Function mtimes has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function mtimes has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
a = 1x3 string array
"😁" "😁" "😁"
b = ["😂";
"😂"
"😂"]
b = 3x1 string array
"😂" "😂" "😂"
c = a*b
c = "😁😂😁😂😁😂"
d = b*a
d = 3x3 string array
"😂😁" "😂😁" "😂😁" "😂😁" "😂😁" "😂😁" "😂😁" "😂😁" "😂😁"
  • matrix multiply matrix:
matrix1 = [
"😀", "😃";
"😄", "😁"]
matrix1 = 2x2 string array
"😀" "😃" "😄" "😁"
matrix2 = [
"😆", "😅";
"😂", "🤣"]
matrix2 = 2x2 string array
"😆" "😅" "😂" "🤣"
resutl = matrix1*matrix2
resutl = 2x2 string array
"😀😆😃😂" "😀😅😃🤣" "😄😆😁😂" "😄😅😁🤣"
enjoy yourself!

Adam
Adam
上次活动时间: 2025-2-17,2:45

I am looking for a Simulink tutor to help me with Reinforcement Learning Agent integration. If you work for MathWorks, I am willing to pay $30/hr. I am working on a passion project, ready to start ASAP. DM me if you're interested.