Contenuto principale

Risultati per

Hello,
I have Arduino DIY Geiger Counter, that uploads data to my channel here in ThingSpeak (3171809), using ESP8266 WiFi board. It sends CPM values (counts per minute), Dose, VCC and Max CPM for 24h. They are assignet to Field from 1 to 4 respectively. How can I duplicate Field 1, so I could create different time chart for the same measured unit? Or should I duplicate Field 1 chart, and how? I tried to find the answer here in the blog, but I couldn't.
I have to say that I'm not an engineer or coder, just can simply load some Arduino sketches and few more things, so I'll be very thankfull if someone could explain like for non-IT users.
Regards,
Emo
Thank you to everyone who attended the workshop A Hands-On Introduction to Reinforcement Learning! Now that you all have had some time to digest the content, I wanted to create a thread where you could ask any further questions, share insights, or discuss how you're applying the concepts to your work. Please feel free to share your thoughts in the thread below! And for your reference, I have attached a PDF version of the workshop presentation slides to this post.
If you were interested in joining the RL workshop but weren't able to attend live (maybe because you were in one of our other fantastic workshops instead!), you can find the workshop hands-on material in this shared MATLAB Drive folder. To access the exercises, simply download the MATLAB Project Archive (.mlproj) file or copy it to your MATLAB Drive, extract the files, and open the project (.prj). Each exercise has its own live script (.mlx file) which contains all the instructions and individual steps for each exercise. Happy (reinforcement) learning!
Is it possible to get the slides from the Hands-On-Workshops?
I can't find them in the proceedings. I'm particularly interested in the Reinforcement Learning workshop, but unfortunately I couldn't participate.
Thanks in advance!
Walter Roberson
Walter Roberson
Ultima attività il 19 Nov 2025 alle 20:42

@Cody Team, how can I vote or give a like in great comments?
It seems that there are not such options.
To track the current leader after each match, you can use cumulative scores. First, calculate the cumulative sum for each player across the matches. Then, after eaayer with the highest score.
Hint: Use cumsum(S, 1) to get cumulative scores along the rows (matches). Loop through each row to keep track of the leader. If multiple players tie, pick the lowest index.
Example:
If S = [5 3 4; 2 6 2; 3 5 7], after match 3, the cumulative scores are [10 14 13]. Player 2 leads with 14 hilbs.
This method keeps your code clean and avoids repeatedly summing rows.
Developing an application in MATLAB often feels like a natural choice: it offers a unified environment, powerful visualization tools, accessible syntax, and a robust technical ecosystem. But when the goal is to build a compilable, distributable app, the path becomes unexpectedly difficult if your workflow depends on symbolic functions like sym, zeta, or lambertw.
This isn’t a minor technical inconvenience—it’s a structural contradiction. MATLAB encourages the creation of graphical interfaces, input validation, and dynamic visualization. It even provides an Application Compiler to package your code. But the moment you invoke sym, the compiler fails. No clear warning. No workaround. Just: you cannot compile. The same applies to zeta and lambertw, which rely on the symbolic toolbox.
So we’re left asking: how can a platform designed for scientific and technical applications block compilation of functions that are central to those very disciplines?
What Are the Alternatives?
  • Rewrite everything numerically, avoiding symbolic logic—often impractical for advanced mathematical workflows.
  • Use partial workarounds like matlabFunction, which may work but rarely preserve the original logic or flexibility.
  • Switch platforms (e.g., Python with SymPy, Julia), which means rebuilding the architecture and leaving behind MATLAB’s ecosystem.
So, Is MATLAB Still Worth It?
That’s the real question. MATLAB remains a powerful tool for prototyping, teaching, analysis, and visualization. But when it comes to building compilable apps that rely on symbolic computation, the platform imposes limits that contradict its promise.
Is it worth investing time in a MATLAB app if you can’t compile it due to essential mathematical functions? Should MathWorks address this contradiction? Or is it time to rethink our tools?
I’d love to hear your thoughts. Is MATLAB still worth it for serious application development?
In just one week, we have hit an amazing milestone: 500+ players registered and 5000+ solutions submitted! We’ve also seen fantastic Tips & Tricks articles rolling in, making this contest a true community learning experience.
And here’s the best part: you don’t need to be a top-ranked player to win. To encourage more casual and first-time players to jump in, we’re introducing new weekly prizes starting Week 2!
New Casual Player Prizes:
  • 5 extra MathWorks T-shirts or socks will be awarded every week.
  • All you need to qualify is to register and solve one problem in the Contest Problem Group.
Jump in, try a few problems, and don’t be shy to ask questions in your team’s channel. You might walk away with a prize!
Week 1 Winners:
Weekly Prizes for Contest Problem Group Finishers:
Weekly Prizes for Tips & Tricks Articles:
Week 1 winner for best Tips & Tricks Articles is @Vasilis Bellos.
Contest problems author @Matt Tearle commented:
We had a lot of people share useful tips (including some personal favorite MATLAB tricks). But Vasilis Bellos went *deep* into the Bridges of Nedsburg problem. Fittingly for a Creative Coder, his post was innovative and entertaining, while also cleverly sneaking in some hints on a neat solution method that wasn't advertised in the problem description.
Congratulations to all Week 1 winners! Prizes will be awarded after the contest ends. Let’s keep the momentum going!
Great material, examples and skillfully guided. And, of course, very useful.
Thanks!
Many MATLAB Cody problems involve solving congruences, modular inverses, Diophantine equations, or simplifying ratios under constraints. A powerful tool for these tasks is the Extended Euclidean Algorithm (EEA), which not only computes the greatest common divisor, gcd(a,b), but also provides integers x and y such that: a*x + b*y = gcd(a,b) - which is Bezout's identity.
Use of the Extended Euclidean Algorithm is very using in solving many different types of MATLAB Cody problems such as:
  • Computing modular inverses safely, even for very large numbers
  • Solving linear Diophantine equations
  • Simplifing fractions or finding nteger coefficients without using symbolic tools
  • Avoiding loops (EEA can be implemented recursively)
Below is a recursive implementation of the EEA.
function [g,x,y] = egcd(a,b)
% a*x + b*y = g [gcd(a,b)]
if b == 0
g = a; x = 1; y = 0;
else
[g, x1, y1] = egcd(b, mod(a,b));
x = y1;
y = x1 - floor(a/b)*y1;
end
end
Problem:
Given integers a and m, return the modular inverse of a (mod m).
If the inverse does not exist, return -1.
function inv = modInverse(a,m)
[g,x,~] = egcd(a,m);
if g ~= 1 % inverse doesn't exist
inv = -1;
else
inv = mod(x,m); % Bézout coefficient gives the inverse
end
end
%find the modular inverse of 19 (mod 5)
inv=modInverse(19,5)
inv = 4
Matt Tearle
Matt Tearle
Ultima attività il 17 Nov 2025 alle 17:50

Congratulations to all the Relentless Coders who have completed the problem set. I hope you weren't too busy relentlessly solving problems to enjoy the silliness I put into them.
If you've solved the whole problem set, don't forget to help out your teammates with suggestions, tips, tricks, etc. But also, just for fun, I'm curious to see which of my many in-jokes and nerdy references you noticed. Many of the problems were inspired by things in the real world, then ported over into the chaotic fantasy world of Nedland.
I guess I'll start with the obvious real-world reference: @Ned Gulley (I make no comment about his role as insane despot in any universe, real or otherwise.)
Matt Tearle
Matt Tearle
Ultima attività il 18 Nov 2025 alle 16:12

Congratulations to all the Cool Coders who have completed the problem set. I hope you weren't too cool to enjoy the silliness I put into the problems.
If you've solved the whole problem set, don't forget to help out your teammates with suggestions, tips, tricks, etc. But also, just for fun, I'm curious to see which of my many in-jokes and nerdy references you noticed. Many of the problems were inspired by things in the real world, then ported over into the chaotic fantasy world of Nedland.
I guess I'll start with the obvious real-world reference: @Ned Gulley (I make no comment about his role as insane despot in any universe, real or otherwise.)
Matt Tearle
Matt Tearle
Ultima attività il 17 Nov 2025 alle 21:43

Fittingly for a Creative Coder, @Vasilis Bellos clearly enjoyed the silliness I put into the problems. If you've solved the whole problem set, don't forget to help out your teammates with suggestions, tips, tricks, etc. But also, just for fun, I'm curious to see which of my many in-jokes and nerdy references you noticed. Many of the problems were inspired by things in the real world, then ported over into the chaotic fantasy world of Nedland.
I guess I'll start with the obvious real-world reference: @Ned Gulley (I make no comment about his role as insane despot in any universe, real or otherwise.)
Athi
Athi
Ultima attività il 17 Nov 2025 alle 15:33

Extracting the digits of a number will be useful to solve many Cody problems.
Instead of iteratively dividing by 10 and taking the remainder, the digits of a number can be easily extracted using String operations.
%Extract the digits of N
N = 1234;
d = num2str(N)-'0';
d =
1 2 3 4
Cephas
Cephas
Ultima attività il 17 Nov 2025 alle 10:25

Instead of looping with if-statements, use logical indexing:
A(A < 0) = 0;
One line, no loops, full clarity.
Cephas
Cephas
Ultima attività il 17 Nov 2025 alle 3:49

Whenever a problem repeats in cycles (like indexing or angles), mod() keeps your logic clean:
idx = mod(i-1, n) + 1;
No if-else chaos!
Madson
Madson
Ultima attività il 13 Nov 2025 alle 20:01

Hi, what’s the best way to learn MATLAB, Simulink, and Simscape? Do you recommend a learning path? I work in the Electrical & Electronics area for automotive systems.
The toughest problem in the Cody Contest 2025 is Clueless - Lord Ned in the Game Room. Thank you Matt Tearle for such as wonderful problem. We can approach this clueless(!) tough problem systematically.
Initialize knowledge Matrix
Based on the hints provided in the problem description, we can initialize a knowledge matrix of size n*3 by m+1. The rows of the knowledge matrix represent the different cards and the columns represent the players. In the knowledge matrix, the first n rows represent category 1 cards, the next n rows, category 2 and the next category 3. We can initialize this matrix with zeros. On the go, once we know that a player holds the card, we can make that entry as 1 and if a player doesn't have the card, we can make that entry as -1.
yourcards processing
These are cards received by us.
  1. In the knowledge matrix, mark the entries as 1 for the cards received. These entries will be the some elements along the column pnum of the knowledge matrix.
  2. Mark all other entries along the column pnum as -1, as we don't receive other cards.
  3. Mark all other entries along the rows corresponding to the received cards as -1, as other players cannot receive the cards that are with us.
commoncards processing
These are the common cards kept open.
  1. In the knowledge matrix, mark the entries as 1 for the common cards. These entries will be some elements along the column (m+1) of the knowledge matrix.
  2. Mark all other entries along the column (m+1) as -1, as other cards are not common.
  3. Mark all other entries along the rows corresponding to the common cards as -1, as other players cannot receive the cards that are common.
Result -1 processing
In the turns input matrix, the result (5th column) value -1 means, the corresponding player doesn't have the 3 cards asked.
  1. Find all the rows with result as -1.
  2. For those corresponding players (1st element in each row of turns matrix), mark -1 entries in the knowledge matrix for those 3 absent cards.
pnum turns processing
These are our turns, so we get definite answers for the asked cards. Make sure to traverse only the rows corresponding to our turn.
  1. The results with -1 are already processed in the previous step.
  2. The results other than -1 means, that particular card is present with the asked player. So mark the entry as 1 for the corresponding player in the knowledge matrix.
  3. Mark all other entries along the row corresponding to step 2 as -1, as other players cannot receive this card.
Result 0 processing
So far, in the yourcards processing, commoncards processing, result -1 processing and pnum turns processing, we had very straightforward definite knowledge about the presence/absence of the card with a player. This step onwards, the tricky part of the problem begins.
result 0 means, any one (or more) of the asked cards are present with the asked player. We don't know exactly which card.
  1. For the asked player, if we have a definite no answer (-1 value in the knowledge matrix) for any two of the three asked cards, then we are sure about the card that is present with the player.
  2. Mark the entry as 1 for the definitely known card for the corresponding player in the knowledge matrix.
  3. Mark all other entries along the row corresponding to step 2 as -1, as other players cannot receive this card.
Cards per Player processing
Based on the number of cards present in the yourcards, we know the ncards, the number of cards per player.
Check along each column of the knowledge matrix, that is for each player.
  1. If the number of ones (definitely present cards) is equal to ncards, we can make all other entries along the column as -1, as this player cannot have any other card.
  2. If the sum of number of ones (definitely present cards) and the number of zeros (unknown cards) is equal to ncards, we can (i) mark the zero entries as one, as the unknown cards have become definitely present cards, (ii) mark all other entries along the column as -1, as other players cannot have any other card.
Category-wise cards checking
For each category, we must get a definite card to be present in the envelope.
  1. In each category (For every group of n rows of knowledge matrix), check for a row with all -1s. That is a card which is definitely not present with any of the players. Then this card will surely be present in the envelope. Add it to the output.
  2. If we could not find an all -1 row, then in that category, check each row for a 1 to be present. Note down the rows which doesn't have a 1. Those cards' players are still unknown. If we have only one such row (unknown card), then it must be in the envelope, as from each category one card is present in the envelope. Add it to the output.
  3. For the card identified in Step 2, mark all the entries along that row in the knowledge matrix as -1, as this card doesn't belong to any player.
Looping Over
In our so far steps, we could note that, the knowledge matrix got updated even after "Result 0 processing" step. This updation in the knowledge matrix may help the "Result 0 processing" step, if we perform it again. So, we can loop over the steps, "Result 0 processing", "Cards per Player processing" and "Category-wise cards checking" again. This ensures that, we will get the desired number of envelop cards (three in our case) as output.
Hoping to see, many of you to finish Cody Contest 2025 and make our team win the trophy.
Hi Everyone!
As this is the most difficult question in problem group "Cody Contest 2025". To solve this problem, It is very important to understand all the hidden clues in the problem statement. Because everything is not directly visible.
For those who tried the problem, but were not able to solve. You might have missed any of the below hints -
  1. “The other players do not get to see which card has been shown, but they do know which three cards were asked for and that the player asked had one of them.” - Even when the card identity isn’t revealed (result = 0), you still gain partial knowledge — the asked player must have at least one of those three cards, meaning you can mark other players as not having all three simultaneously.
  2. "If it is your turn, you know the exact identity of that card" - You only know the exact shown card when result = 1, 2, or 3 — and it must be your turn. If someone else asked (even if you know result = 0), you don’t know which one was shown. So the meaning of result depends on whose turn it was, which is implicit — MATLAB code must assume that turns alternate 1→m→1, so your turn index is determined by (t-1) mod m + 1 == pnum.
  3. "Any leftover cards are placed face-up so that all players can see them" - These cards (commoncards) are not in anyone’s hand and cannot be in the envelope. So they’re not just visible — they’re logical constraints to eliminate from deduction.
  4. “It may be possible to determine the solution from less information than is given, but the information given will always be sufficient.”
  5. "Turn order is implied, not given explicitly" - Players take turns in order (1 to m, and back to 1).
On considering all the clues and constraints in the question, you will definitely be able to card for each category present in envelope.
I hope above clues will be useful for you.
Thank you, wishing you the success!
Regards,
Dev
Experimenting with Agentic AI
44%
I am an AI skeptic
0%
AI is banned at work
11%
I am happy with Conversational AI
44%
9 voti
Cephas
Cephas
Ultima attività il 13 Nov 2025 alle 2:40

Instead of growing arrays inside a loop, preallocate with zeros(), ones(), or nan(). It avoids memory fragmentation and speeds up Cody solutions.
A = zeros(1,1000);