Main Content

Results for

Urs
Urs
Last activity about 7 hours ago

I have been using MATLAB on a daily basis for more than 30 years. For the past few months, I have been working with version 2026, and the problems I have encountered are staggering, especially when debugging functions.
The issues started to appear gradually with R2026a. Suddenly, the cursor would disappear, copy and paste would stop working, and MATLAB often had to be restarted because of these issues. In addition, the new figure UI is painfully slow, and entering debug mode has become frustrating. When stepping through code, MATLAB can take several seconds to respond to a debugging command such as Step.
Today, I finally got fed up and reinstalled R2024b. It works perfectly fine.
My entry for the one-button game mini hack, LIGHTKEEPER, puts you in a lighthouse on a reef. Ships sail in blind from the dark. The beam sweeps on its own, and one tap reverses its spin. Any ship the light touches turns for home.
How to play
  • A tap reverses the beam. It has inertia, so a reversal takes about a third of a second.
  • Boats are rescued the moment the light touches them: 1 point.
  • Freighters need 0.6 s of light: 3 points. The arc around the ship shows progress.
  • A lantern blinking red means that ship is close to the reef. Three wrecks and the lamp goes out.
Tips for a high score
  • Tap fast to make the beam hover. Quick reversals cancel out, and a slow beam lights freighters three times faster.
  • Swing toward the ship closest to the reef, not the one closest to the beam.
  • Don't mash. In my bot tests, random tapping lost in about 19 s, and never tapping in about 39 s.
MATLAB tricks inside
  • Every position is a complex number, so z.' + outline.*exp(1i*heading.') turns and places the whole fleet at once. Use .', because ' also conjugates.
  • All ships are one patch with a face per ship. NaN vertices hide the ones not sailing. The whole game is 24 graphics objects.
  • The beam is a patch with per-vertex alpha ('FaceAlpha','interp'), built once and turned with an hgtransform.
  • Setting the axes limits every frame, even to the same values, added about 5 ms to each frame. The screen shake now touches the axes only while it's running.
How long can you keep the lamp lit?
Hi everyone! I made PULSE // PALS - Lumi & Afterglow for the One-Button Game Mini Hack.
Play the published game:
https://www.mathworks.com/matlabcentral/communitycontests/contests/10/entries/16481
Press SPACE or click when a diamond reaches the small ring beneath Lumi. Release between taps. There is no aiming or dragging. The game has 64 authored notes across eight visual phrases, with a tempo that gradually rises from 96 to 136 BPM.
The submitted version passed minihackContest.validate at 9,778 characters, with no banned functions reported. Here are the most useful lessons from building it. The short code examples below use descriptive names for explanation; they are not additional files required to play.
1. Make the moving target and the notes share one beat coordinate
The target drifts and the rail bends, but the input is still about timing. A note must meet the ring at its scheduled beat, wherever the ring has moved.
For a note at noteBeat and a current beat b, define d = noteBeat - b. This simplified example uses the same rail formula as the game:
rail = @(d,b) 22*(sin(.72*d+.22*b)-sin(.22*b)) ...
+ 26*sin(pi*b/12).*tanh(d/2);
b = 12.5;
noteBeat = 14;
targetX = 218 + 58*sin(pi*b/8);
targetY = 306 + 37*sin(pi*b/6);
spacing = 91*(1+.09*sin(pi*b/4));
d = noteBeat - b;
noteX = targetX + spacing*d;
noteY = targetY + rail(d,b);
The useful invariant is rail(0,b) = 0. At d = 0, the note and target coincide. The hit test uses beat distance, rather than mouse position or a pixel collision. That keeps the animation and timing rule connected while leaving room to change the path.
2. Animate a character's parts, then batch the drawing
Lumi is procedural geometry, not an imported sprite. The ears, hands, blinking eyes, star pin, and two scarf tails have separate motion. A shared transform adds tilt and squash-and-stretch.
All 22 colored character polygons are held in one patch object; the mouth uses one additional line. Independent animation does not require an independent graphics object for every body part.
Complex coordinates are a convenient way to express 2-D transforms. For local points z, rotation angle theta, and a position x0,y0:
zWorld = (x0 + 1i*y0) + z*exp(1i*theta);
set(h,'XData',real(zWorld),'YData',imag(zWorld));
The game creates its graphics objects during initialization and reuses them. It also avoids setting text when the string has not changed:
if ~strcmp(label.String,newText)
label.String = newText;
end
The main waveform uses 177 on-screen samples instead of storing a whole song-length curve in the scene. Background geometry has a separate update gate. These reduce unnecessary work; they are not a promise of a particular frame rate in MATLAB Online.
One testing lesson: check the effective face colors, not only one expected CData array shape. With flat shading, per-face colors and per-vertex colors need to be interpreted correctly; for the latter, the first vertex determines the face color.
3. Make the strongest effects something the player earns
A catch makes Lumi rebound and produces a ring around the target. Eight consecutive catches outside Afterglow fill the constellation and start an eight-beat double-scoring interval for subsequent notes. The palette warms, the scarf extends, and the surrounding shapes become stronger.
I wanted the visual changes to explain what the player had achieved. The background stays comparatively restrained between these moments so that the next diamond remains readable. The chart is fixed rather than randomized, so replaying also means learning its pauses and short runs of notes.
4. A slow frame is not proof that the player left
An earlier version paused whenever an update interval exceeded 0.8 seconds. During MATLAB Online playtesting, it repeatedly paused just after starting. The code was treating elapsed time as if it were a window-focus event.
I removed that automatic-pause condition. The submitted version bounds a simulation step to 0.1 seconds and marks slow sessions PRACTICE. This avoids a large catch-up jump, but intentionally allows the game to run slower than wall-clock time under sustained load. It does not fix rendering throughput or network latency.
A browser prototype helped with visual iteration, but browser smoothness is not a measurement of the MATLAB version. Testing in the official runner caught a problem that screenshots and reference simulations did not.
5. Pack data, and let the official validator decide the size
Some geometry, palette, and chart tables are stored as character arrays and decoded into numbers. For a small integer table, the principle is:
values = [0 2 4 6];
packed = char(13312 + values);
restored = double(packed) - 13312;
assert(isequal(values,restored));
Those unusual-looking characters are numerical data. They are not dynamically executed code. Keep values in a safe character range, preserve the source encoding, and verify that decoding reproduces the original table.
The distinction between character arrays and string scalars matters: double('ABC') returns character codes, while double("ABC") attempts a numeric conversion and returns NaN. My decoder receives character arrays.
Raw file size was not a reliable way to judge the contest budget. I used minihackContest.validate for the final decision and kept an expanded numeric copy for inspection. Compact data, shared drawing helpers, and fewer repeated statements were more useful than merely deleting whitespace.
Working with AI
AI assistance was used for implementation, iteration, and testing support. I playtested the game and used visible problems to steer changes: the first designs were too static, the character felt like a sticker, and the slow-frame pause rule failed in actual use. The important lesson was to keep reference-model checks, native validation, and real playtesting separate.
Useful MATLAB documentation
Graphics performance:
https://www.mathworks.com/help/matlab/creating_plots/improve-graphics-update-performance.html
Patch colors and properties:
https://www.mathworks.com/help/matlab/ref/matlab.graphics.primitive.patch-properties.html
Character codes and numeric conversion:
https://www.mathworks.com/help/matlab/matlab_prog/unicode-and-ascii-values.html
What visual cues help you anticipate a beat when there is no sound? I would be interested to hear what other Mini Hack participants have tried.
One-Button Game Mini Hack Entry: Pump-Send
Hi everyone! Pump-Send is a side-view mountain bike game on an endless desert pump track. You never pedal: all your speed comes from pumping the rollers, and one button does everything. On the ground, a tap pumps or pops; in the air, it throws you into a backflip.
How scoring works
  • You get 1 point for every meter you ride. The run ends if you run out of momentum or crash.
  • Every clean backflip is worth 50 points, so one flip equals 50 meters of riding.
  • Your score and flip count are shown in the top-left corner.
Definitions
  • Pump: A tap while rolling downhill. You push the bike into the slope and gain speed.
  • Scrub: A tap at the wrong time (going uphill, or a second tap right after a pump). It costs you a little speed.
  • Lip: The rising face just before the top of a hill. It glows yellow.
  • Pop: A tap on a glowing lip. It's the only way to get airborne.
  • Flip: A tap in the air spins the rider backward. Each full rotation you land counts as one flip. Tap only; don't hold the button.
  • Stall: Going too slow for too long. This ends the run.
Physics you'll want to know
  • Steeper downhill = bigger pump. A pump on a steep drop gives you a big shove, about a third of your starting speed. On a nearly flat stretch, it does almost nothing. Aim for one good pump on each downhill.
  • Scrubs add up. A badly timed tap only takes back about a third of a good pump, but a few in a row can leave you crawling.
  • Watch the hills scroll. If the scenery slows down and you're barely making it over the crests, pump now or you'll stall.
  • Speed is hang time. The faster you hit a glowing lip, the higher and longer you fly, and the more time you have to finish a flip.
  • Spin fades in the air. Each tap adds spin, and the spin slowly dies down. More taps spin you faster, but you have to be wheels-down at the right angle when you touch the ground.
  • Land matching the slope. Don't start another flip if you won't finish it in time to land at the right angle.
Quick tips
  • Build speed with a few pumps before you try your first flip.
  • On a big jump, one tap in the air is usually a full flip. Count, then stop tapping.
  • When in doubt, skip the flip: distance points still add up.
  • The game gets harder as you go, with tighter pump timing and landing requirements.
Behind the scenes
I built Pump-Send with a team of Claude Code agents: one designed the game, one wrote the tests (113 of them!), one built it, one reviewed the code, and one judged prototypes to help me choose among my four original ideas. The judging turned out to be less useful than I expected, since it was pretty obvious after playing which idea would pan out best. The most interesting lesson for me was about using bots to tune the physics.
Lesson one: the bot was too good
The first bot was simply too good at the game. It predicted where each jump would land and planned its flips accordingly, scoring hundreds of points. Then I took the wheel (err, handlebars) and crashed in seconds.
So I had the agents build a bot that plays like a person. It makes the same decisions, but each tap arrives 100 ± 60 ms late, it waits to see what one tap did before deciding again, and it taps at most 10 times per second. That bot survived a median of 8 seconds and crashed in 17 of 30 rides.
Here's what it uncovered and what I changed:
  • A slightly late tap on a lip turned into a backflip spin on a tiny hop. Now you only leave the ground when you tap.
  • Riders landed on the next uphill 55–68% of the time. Now a lip glows only if a pop at your current speed will land on a downhill.
  • A flat dead zone at every crest turned late taps into scrubs. It's gone.
  • Everything runs in gentle slow motion (0.8×), so every timing window lasts 25% longer.
  • In most flips, the rider's head went through the ground. Now the rider spins around the hips.
After those fixes, the human-like bot survived a median of 53 seconds with 0 of 30 crashes. "The human-like bot survives at least 30 seconds" is now a permanent test for every new build.
Lesson two: bad players on purpose
Bots that play badly are just as useful. Every build is tested against `idle` (never taps), `spam` (taps every frame), and `masher` (8 taps per second). Each one has to die within 15 seconds or score under a fifth of what the scripted bot scores, so you can't win by ignoring or mashing the button. A `random` tapper rounds out the lineup.
Results for the current build, 20 rides of up to 60 seconds each (a different set of rides from the 30 above, so the human-like numbers differ a little):
+------------+----------------------------+-----------------+--------------+--------------+
| Bot | How it plays | Median survival | Median score | Median flips |
+------------+----------------------------+-----------------+--------------+--------------+
| idle | Never taps | 12.8 s | 40 | 0 |
| spam | Taps every frame | 2.2 s | 1 | 0 |
| masher | 8 taps per second | 2.3 s | 9 | 0 |
| random | Random taps | 6.2 s | 30 | 0 |
| human-like | Smart taps, 100 ms late | 46.3 s | 801 | 8.5 |
| scripted | Smart taps, perfect timing | 51.2 s | 1,391 | 14.5 |
+------------+----------------------------+-----------------+--------------+--------------+
Your turn
What's your high score? Did you beat the human-like bot? I'd love to hear if anyone lands three flips in one jump.
pippis
pippis
Last activity about 4 hours ago

Hi there,
Is there a change in the json response when I do http write to a channel ?
I send:
POST /update.json HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: api.thingspeak.com
Connection: close
Content-Length: 102
apikey=xxxxxxxxxxxx&field1=-4.803&field3=18&field4=91&field5=109&field6=56&field7=0&field8=7
and I don't receive the normal response
I get sth like:
'unsafe-eval'; style-src 'self' https: 'unsafe-inline'; connect-src 'self' https: https://*.mathworks.com https://*.thingspeak.com https://*.omtrdc.net https://*.demdex.net; frame-src 'self' https: https://*.mathworks.com
Once you've uploaded your one-button game, it doesn't seem like there's a way to edit/update it. That's led me to fall into a couple of traps. One has a simple solution, so I'll share it. The other has me still scratching my head, so I'll open it up for discussion.
  • Restarting. While you're developing and testing in MATLAB, it's easy enough to close the window and rerun your game. But the process is clunkier in the online gallery, so make sure your game includes a clean way to restart. If you're using an agent, it's easy enough to instruct it to modify the spacebar/click callback when the game ends so that it now calls the start/initialization function. This is a nice job for an agent (standard coding pattern it will probably do right, while I'll mess up and get annoyed).
  • Timing. I can't figure out how to translate frame rate on my slow desktop MATLAB to the online running framework. Things that seem very sedate while testing suddenly get very exciting when I upload. Anyone know a good way to emulate just how zippy the real game will be?
My entry for the one-button game mini hack Lunar Lander - Tap to Burn, is a one-button powered descent. You start 500 m above the surface, falling at 10 m/s, with 200 kg of propellant. One tap turns on the engine, and the next tap stops it.
How scoring works
  • Crash: landing at 3 m/s or faster scores 0.
  • Abort: rising above 750 m scores 0.
  • Safe landing: below 3 m/s scores 10 points per kilogram of fuel remaining.
  • Perfect touchdown: below 1 m/s doubles the reward to 20 points per kilogram of fuel remaining.
Physics in the game
  • Fuel mass decreases as propellant is burned.
  • Gravity continuously accelerates the lander downward.
  • The engine does not reach full thrust instantly, so timing matters.
  • The display turning red indicates when a full thrust landing burn becomes possible.
Display readouts
  • ALT [m]: Height above the surface.
  • V/S [m/s]: Vertical speed.
  • FUEL [kg]: Remaining propellant.
  • dV [m/s]: remaining velocity change the fuel can provide, from the rocket equation Δv=Isp·g₀·ln(m/m_dry).
  • T/W: Thrust to weight ratio.
My best so far is 1300. Has anyone managed a sub 1m/s landing?
Cephas
Cephas
Last activity on 3 Nov 2026 at 14:28

The day and night colours depend on how far the fox has run. Instead of recolouring everything on every frame, I turn the cycle into a small number of steps and only recolour when the step changes:
nn=.5-.5*cos(2*pi*s.dist/3200);
q=round(nn*40);
if ~isequal(s.ax.UserData,q)
s.ax.UserData=q;
% recolour the background, ground, text and obstacles here
end
The current step is stored in the axes UserData, so the check is cheap. Text works the same way. I only set a text string when the new string is different from the old one:
if ~strcmp(s.sct.String,t), s.sct.String=t; end
Setting properties that have not changed still costs time in every frame, so skipping them helps a lot in a game that redraws many times per second.
Check against your code: the first block is simplified from your renderFrame. Your real code also adds +100*(s.st==2) to q so the colours change on the game-over screen, and I left that out to keep the tip simple. The strcmp line is from your score text. Both matc
The day and night colours depend on how far the fox has run. Instead of recolouring everything on every frame, I turn the cycle into a small number of steps and only recolour when the step changes:
nn=.5-.5*cos(2*pi*s.dist/3200);
q=round(nn*40);
if ~isequal(s.ax.UserData,q)
s.ax.UserData=q;
% recolour the background, ground, text and obstacles here
end
The current step is stored in the axes UserData, so the check is cheap. Text works the same way. I only set a text string when the new string is different from the old one:
if ~strcmp(s.sct.String,t), s.sct.String=t; end
Setting properties that have not changed still costs time in every frame, so skipping them helps a lot in a game that redraws many times per second.
All the graphics objects (patches, lines and text) are created one time, when the game starts. After that, the render function only changes their data with set:
set(s.hd,'XData',s.DS{k}+DX,'YData',s.DT{k}+G+s.dy)
Creating new objects on every frame is a common reason MATLAB games feel slow. Updating objects that already exist is much cheaper. To hide an object, I set its data to NaN instead of deleting it:
set(s.ho(m),'XData',NaN,'YData',NaN)
Disclosure: the game code was written with Claude (an AI assistant). I tested the game in MATLAB and checked the details myself.
For the One-button Game Mini Hack, the code limit is 10,000 characters. I made a game called Ember Fox, where a fox runs and a stone guardian chases it, and you have one button. These are the techniques in the code that I found most useful.
Tip 1: Draw pixel-art sprites from text
Each sprite is stored as a grid of characters, where # is a filled pixel and . is empty:
A=['######';'#.##.#';'######';'.####.'];
[X,Y]=spr(A,0.6);
A helper function, spr, turns the grid into rectangles. For each row it uses diff to find where every run of # starts and ends, and each run becomes one rectangle instead of one rectangle per pixel. This keeps the sprite data small and the number of graphics objects low. All the sprites are built once, when the game starts.
If you are as excited as me to play these games but somehow something is stopping you from doing just that, you are at the right place. Follow the steps below and you will be playing in no time (maybe some time depending on your browser, network speed, etc.):
  1. Click on the game you like the look of (let's say, something that is transformative).
  2. This will open up its details page with the game code, preview video and the "Play Game" button. Click the video or the button.
  3. This will open up "MATLAB Drive" in a new browser window with a preview screenshot of a half-played game and a "Run this App" button. Click this button and nothing will seem to happen at first. And nothing will happen at any other subsequent tries. But don't worry, that's why you're here.
  4. Click on the "entry-×××××" blue hyperlink just above the preview area (underlined in red above). This will take you to a list of two files but hide the crucial blue button. Click on the "Entry×××××.mlapp" file to resurface the blue button.
  5. With expectant hands, click the "Run this App" button. This time it will reload the "MATLAB Drive" and put it in the mode to run your chosen game.
  6. Finally, you are where you expected to be in the point 3! Enjoy your game.🥳
Hi everyone,
I made Ember Fox: Outrun the Stone Guardian for the One-button Game Mini Hack. A fox runs forward, and a stone guardian rolls behind it and chases it. You must hop over obstacles to stay ahead.
Play it here: https://www.mathworks.com/matlabcentral/communitycontests/contests/10/entries/16448
(Click Play Game, then Run this App.)
The whole game fits in less than 10,000 characters. Below are the main tricks I used. I hope they help you with your own games.
How the game works
  • One button does everything: tap to hop, tap again in the air to dive.
  • If you hit an obstacle, the stone guardian gets closer. If it catches you, the game ends.
  • Diving onto a flying enemy gives bonus points.
  • Power-ups give a shield, slow motion, or push the guardian back.
  • Passing obstacles builds a combo multiplier.
  • The game gets faster the longer you play, and the sky changes from day to night.
Trick 1: Draw pixel-art sprites from text
I draw each sprite as a grid of characters. A # means a filled pixel:
A=['######';'#.##.#';'######';'.####.'];
[X,Y]=spr(A,0.6);
My helper function spr turns each row into rectangles. It uses diff to find where every run of # starts and ends. One run becomes one rectangle, not one rectangle per pixel. This keeps the number of graphics objects low and the code short.
Trick 2: Create graphics once, then only update them
In init I create every patch, line and text object one time. In renderFrame I only change them with set:
set(s.hd,'XData',s.DS{k}+DX,'YData',s.DT{k}+G+s.dy)
Creating new objects every frame makes a game slow. Updating existing ones is much faster. To hide an object, I set its data to NaN instead of deleting it.
Trick 3: Update only what changed
The day and night colours depend on how far you have run. I turn the cycle into a small number of steps and change the colours only when the step changes:
nn=.5-.5*cos(2*pi*s.dist/3200);
q=round(nn*40);
if ~isequal(s.ax.UserData,q)
s.ax.UserData=q; % change all colours here
end
I do the same for text. I only set the text when the new text is different:
if ~strcmp(h.String,t), h.String=t; end
Trick 4: One button, different actions
The game state decides what the button does:
  • On the start or game-over screen, it starts the game.
  • On the ground, it makes the fox hop.
  • In the air, it makes the fox dive down faster.
This gives the player more choices without adding more buttons.
Trick 5: Smooth difficulty and simple collisions
The speed grows quickly at first, then slows down, so the game stays fair:
s.spd=55+90*(1-exp(-s.sc/900));
Collisions are simple rectangle checks. After a hit, the fox is safe for a short time, so one mistake does not cause many hits in a row.
Trick 6: Fit the character limit
  • Use short variable names.
  • Use loops and shared code instead of repeating lines.
  • Run minihackContest.validate often to check the character count.
Known problem: the game runs smoothly in desktop MATLAB, but it can lag in MATLAB Online. For the best experience, run it on your computer with minihackContest.play.
Thank you for reading! If you have questions or ideas to make it better, please write a comment. I would love to see how you solve these problems in your own games.
I have MATLAB R2026b, the MATLAB Agentic Toolkit, and Claude Code installed.
In the first session, I asked Claude (Opus 5.5, High effort) to review the game rules, suggest MATLAB Agentic Toolkit skills, install them inside the project folder, and create a CLAUDE.md file.
In the second session, I asked Claude to create a combat game in which the player controls a simple stick figure wielding a club; clicking makes the figure swing the club. Simple monsters approach the player and drain the player’s health on contact, while hitting a monster with the club eliminates it. The game has an old-school 2D look, with a dark blue, star-filled background and light blue characters.
That's it. You can see result here: CLUB NIGHT
My best score until now is 2060.
Let me know your best score in the comments.
CLUB NIGHT - GAME OVER
I started my game for this contest, Stack OverDad, one month before the contest began. Dad tells programming jokes at the dinner table, and you have to laugh at the right moment. I was very happy with it. It had a dog, a little brother with a spoon, a window with a sun that goes down, fifty jokes, and many small animations.
Then the contest started, and I read the rules again. One line said: each entry is limited to 10,000 characters of MATLAB code.
My code had more than 70,000 characters.
So, as you can guess, the next hourse were cut, test, cut, test, cut... In this post, I will tell you what I learned on the way (from my AI friend!). Some of it surprised me.
Step 1: Cut What the Player Does Not Feel
For every part of the game, I asked: "Does the player really feel this?"
The dog: cute, but no. The brother: funny, but no. The sunset: nobody looks at the window when Dad tells a joke. Forty jokes: a game only uses ten anyway.
This was the biggest step, and the hardest, because I liked all of these things. But the game did not get worse. It got clearer. After this, my file had about 9,800 characters. I was done!
Step 2: The Surprise
The contest project has a command to check the game before you submit it:
minihackContest.validate
I ran it, and it said:
Validation failed: game.m exceeds the character limit (16145 / 10000, comments excluded).
16,145? My file had 9,800 characters. I counted again. It still had 9,800.
So I opened the validator to see how it counts. This is the line:
charCount = strlength(char(tree2str(mtree(gameFile, '-file'))));
mtree reads the code into a tree, and this removes the comments. Then tree2str writes the code again, in a clean, standard layout. The validator counts that text, not my file.
And the clean layout is not short at all. For example, this one line of mine:
if p,pr(s.T);end
comes back from tree2str like this:
if p
pr( s.T );
end
Every statement gets its own line. Every line gets indentation. Every f(a,b) becomes f( a, b ), and every [1 2 3] becomes [ 1, 2, 3 ]. My short style was not short anymore.
The good news: now I knew the real rule, so I could play by it.
Step 3: What Is Cheap and What Is Expensive
  • Expensive: many statements, deep nesting, and long lists of numbers.
  • Cheap: text inside a string. tree2str does not change a string at all.
So the plan was: fewer statements, less nesting, and move numbers into strings.
Example 1: Many Values in One Statement
s.st = 3;
s.t0 = t;
s.la = -1;
becomes one statement with deal:
[s.st, s.t0, s.la] = deal(3, t, -1);
Example 2: A Small if Without if
if n == 1
s.fl = "TEN?!";
end
With logical indexing, it is one line. If the condition is false, nothing changes:
s.fl(n == 1) = "TEN?!";
Example 3: Many Strings in One String
A list like ["PERFECT!", "GOOD!", "TOO LATE..."] pays for every ", ". One string with a separator is cheaper:
B = split("PERFECT!|GOOD!|TOO LATE...", "|");
All fifteen jokes are now one string too.
Example 4: Numbers Inside a String
This was the biggest trick. My scene (the table, the chairs, Dad, the family) is made of rectangles, ellipses, and polygons. That is hundreds of numbers.
So I stored each number as one character in a string. A character is really a number (its code), so I can turn it back:
v = double(char(z))/20 - 1025; % every character of z becomes one number again
I chose codes from a big block of normal, printable characters. They look like Chinese characters, but they are not words. I only use their codes. One small loop reads the string and draws all the shapes with patch. Now the whole scene costs about one character per number.
One warning from my own mistake: use double(char(z)), not double(z). If z is a string, double(z) gives NaN. My first test showed an empty table because of this.
I kept the readable list of shapes in a separate file, and it writes the packed strings for me.
I Had Help
I worked with an AI assistant the whole way. It read the validator with me, tested many small ideas fast, measured which part of the code cost the most, and rewrote code again and again without getting tired.
But the AI did not decide what the game is. It could tell me that the dog costs 1,700 characters. It could not tell me if the dog is worth it. Every "keep" or "cut" was my choice. I think this is the best way to work with AI: let it do the heavy lifting, and keep the decisions for yourself.
The Result
The validator now says 9,936 characters. The game still has Dad, THE LOOK, Mom's warnings, the family walking out, the ranks, and fifteen jokes.
My advice: run minihackContest.validate early. Do not count the characters yourself, because the validator does not count your file. It counts the clean version of your file.
I hope you have found this helpful. Thank you for reading.
Damdinsvren Bayasgalan
Damdinsvren Bayasgalan
Last activity on 1 Nov 2026 at 23:41

Hello everyone, I am new to Matlab.
I am trying to create an app to export the 5th column into a new sheet in the imported Excel file when I click Export button.
How can I write code in ExportButtonPushed
classdef test < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
ExportButton matlab.ui.control.Button
UITable matlab.ui.control.Table
ImportButton matlab.ui.control.Button
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: ImportButton
function ImportButtonPushed(app, event)
[file, location] = uigetfile( ...
{'*.xlsx;*.xlsm', 'Excel files'; '*.txt', 'Text files'; '*.*', 'All files'}, ...
'File Selector');
figure(app.UIFigure)
if isequal(file, 0), return, end
fullPath = fullfile(location, file);
try
[~,~,ext] = fileparts(fullPath);
if any(strcmpi(ext, {'.xlsx','.xlsm','.xls'}))
T = readtable(fullPath, 'Sheet', 1, 'VariableNamingRule', 'preserve');
else
T = readtable(fullPath, 'VariableNamingRule', 'preserve');
end
catch ME
uialert(app.UIFigure, ME.message, 'Read error');
return
end
if width(T) < 5
uialert(app.UIFigure, 'The file needs at least 5 columns.', 'Import error');
return
end
app.UITable.Data = T;
app.UITable.ColumnName = T.Properties.VariableNames;
lengthlist = T{:,5};
end
% Button pushed function: ExportButton
function ExportButtonPushed(app, event)
Recently, I encountered an issue where solve returned no solution for a system of equations, even though the system obviously has solutions. This can be easy to overlook.
For example:
syms a b c x
equs = [a*x^2+b*x+c==0;
a==1];
St = solve(equs,x)
St = Empty sym: 0-by-1
St is returned as an empty set, suggesting that there is no solution???
However, since a is constrained by the equation a == 1, the correct way is:
S = solve(equs,[x,a])
S = struct with fields:
x: [2×1 sym] a: [2×1 sym]
disp(S.x)
disp(S.a)
Here, a must also be included in the list of variables to solve for. Only then will solve treat a as an unknown, apply the constraint a == 1, and substitute it into the equation during the solving process.
symvar(equs)
Based on the output of the symvar function, a is already identified as one of the symbolic variables (unknowns) in the system of equations. However, the actual behavior of solve appears to contradict this expectation. In practice, a must still be explicitly included in the variable list passed to solve; otherwise, it is treated as a symbolic parameter rather than a variable to be solved for.
Takeaway: When using solve for a system of equations, any symbol that appears in the equations and is constrained by additional equations (such as a == 1) should generally be included in the variable list. Otherwise, solve may treat it as a symbolic parameter rather than an unknown, which can lead to an empty solution set or unexpected results.
Am I missing something here? I'd love to hear your thoughts.
HDFql
HDFql
Last activity on 25 Oct 2026 at 14:54

As a long-standing request from users, we are happy to announce that HDFql now supports MATLAB for managing HDF5 and MAT files.
In short, HDFql (Hierarchical Data Formal query language) is the first high-level, declarative language for managing HDF5 or MAT data. Designed to be as simple and powerful as SQL, it dramatically reduces the learning effort and time required to work with HDF5. With its intuitive syntax, HDFql provides a clean interface for reading and writing HDF5 data across programming languages (C, C++, Java, Python, C#, Fortran, R, and now MATLAB) and platforms (Windows, Linux, and macOS). In addition, HDFql is based on a flexible parallel architecture that transparently leverages available cores and, in MPI clusters, nodes to efficiently process large volumes of data.
Key benefits of HDFql include enabling users to replace dozens of lines of complex HDF5 code with just a few lines of simple code, helping AI models generate better code using far fewer tokens, and making AI-generated code easier for humans to review.
Happy coding, prompting, or reviewing with HDFql in MATLAB!
Martin
Martin
Last activity on 23 Oct 2026 at 21:00

We use Timecontrol for statistic automations. Yesterday at 2026-10-220 10:00pm CET Time control stopped working. There is new new time in the "Run At" field, although the script should run every 5 minutes. We had the same problem in September, see https://de.mathworks.com/matlabcentral/answers/2184870-thingspeak-timecontrol-stopped-working-at-all?s_tid=srchtitle
Has anybody also prolems with Timecontrol?
Pooja
Pooja
Last activity on 16 Oct 2026 at 13:40

I am frequently facing issue with the onramp training of not proceeding to the next task or section, even after successfully completion of the current task or complete section.
For the past several days I have been experiencing a problem with data visualization on two of my ThingSpeak channels.
The data appears to be uploaded and stored correctly, and new entries are still being added to the channels. However, the visualizations are not working correctly.
The standard Field Charts show only a very small number of data points instead of the normal continuous measurements. Most of the points are compressed on the left side of the chart, while one or a few points appear far to the right and are connected by long straight lines. The time axis is also incorrect and sometimes shows repeated dates such as “01 Jan”.
The numeric widgets are affected as well and display incorrect values. Some custom visualizations also remain blank or fail to load.
The problem appeared suddenly and affects two separate channels which had previously been working correctly. I did not make any significant changes to the channels before the problem started.
This seems somewhat similar to the ThingSpeak chart/timeline issue reported in June 2026, when charts were displaying incorrect time ranges and the DAYS/RESULTS settings were not working correctly. However, my current problem also affects numeric widgets and custom visualizations, and the charts show incorrect dates and strangely positioned data points.
Could this be a regression or a similar issue with the ThingSpeak visualization system?
Has anyone else experienced the same problem recently?