主要内容

Results for


We're thrilled to announce the roll-out of some new features that are going to supercharge your Playground experience! Here's what's new:
Copy/Download code from the script area
You can now effortlessly Copy/Download code from the script area with just a single click. Copy code or Download your script directly as .m files and keep your work organized and portable.We hope this will allow you to effortlessly transfer your work from Playground to MATLAB Desktop/Online.
Run Code directly from the Chat panel
Execute code snippets from the chat section with a single click. This new affordance means saving a step since you no longer have to insert code and then hit run from the toolstrip to execute instead just hit run in the chat panel to see the output immediately in the script area
Enhanced visual Experience
Customize your Playground workspace by expanding or collapsing the chat and script sections. Focus on what matters most to you, whether it's AI chat or working on your script.
We hope you will love these updates. Try them out and let us know your feedback.
When I want to understand a problem, I'll often use different sources. I'll read different textbooks, blog posts, research papers and ask the same question to different people. The differences in the solutions are almost always illuminating.
I feel the same way about AIs. Sometimes, I don't want to ask *THE* AI...I want to ask a bunch of them. They'll have different strengths and weaknesses..different personalities if you want to think of it that way.
I've been playing with the AI chat arena and there really is a lot of difference between the answers return by different models. https://chat.lmsys.org/?arena
I think it would be great if the MATLAB Chat playgroundwere to allow the user to change which AI they were talking with.
What does everyone else think?
I have been finding the AI Chat Playground very useful for daily MATLAB use. In particular it has been very useful for me in basically replacing or supplementing dives into MATLAB documentation. The documentation for MATLAB is in my experience uniformly excellent and thorough but it is sometimes lengthy and hard to parse and the AI Chat is a great one stop shop for many questions I have. However, I would find it very useful if the AI Chat could answer my queries and then also supply a link directly to the documentation. E.g. a box at the bottom of the answer that is basically
"Here is the documentation on the functions AI Chat referred to in this response"
could be neat.
Hi
I am using simulink for the frequency response analysis of the three phase induction motor stator winding.
The problem is that i can't optimise the pramaeter values manually, for this i have to use genetic algrothem. But iam stucked how to use genetic algorithum to optimise my circuit paramter values like RLC. Any guidence will be highly appreciated.
sky
sky
Last activity 2024-1-18

I'm having problem in its test 6 ... passing 5/6 what would be the real issue..
am wring Transformation matrix correct.. as question said SSW should be 202.5 degree...
so what is the issue..
I am a beginner of deep learning, and meet with some problems in learning the MATLAB example "Denoise Signals with Adversarial Learning Denoiser Model", hope very much to get help!
1. visualizaition of the features
It is my understanding that the encoded representation of the autoencoder is the features of the original signal. However in this example, the output dimension of the encoder is 64xSignalLength. Does it mean that every sample point of the signal has 64 features?
2. usage of the residual blocks
The encoder-decoder model uses residual blocks (which contribute to reconstructing the denoised signal from the latent space, ). However, only the encoder output is connected to the discriminator. Doesn't it cause the prolem that most features will be learned by the residual blocks, and only a few features that could confuse the discriminator will be learned by the encoder and sent to the discriminator?
I have been developing a neural net to extract a set of generative parameters from an image of a 2-D NMR spectrum. I use a pair of convolution layers each followed by a fullyconnected layer; the pair are joined by an addtion layer and that fed to a regression layer. This trains fine, but answers are sub-optimal. I woudl like to add a fully connected layer between the addtion layer and regression, but training using default training scripts simply won't converge. Any suggestions? Maybe I can start with the pre-trained weights for the convolution layers, but I don't know how to do this.
JHP
This is not a question, it is my attempt at complying with the request for thumbs up/down voting. I vote thumbs up, for having AI.....
I am not sure if specific AI errors are to be reported. Other messages I just read from others here and the AI Chat itself clearly state that errors abound.
My AI request was: "Plot 300 points of field 2"
AI Chat gave me, in part:
data = thingSpeakRead(channelID, 'Fields', 2, 'NumPoints', 300, 'ReadKey', readAPIKey);
% Extract the field values
field1Values = data.Field1;
% Plot the data
plot(field1Values);
The AI code failed due to "Dot indexing is not supported for variables of this type"
So, I corrected the code thus to get the correct plot:
data = thingSpeakRead(channelID, 'Fields', 2, 'NumPoints', 300, 'ReadKey', readAPIKey);
% Extract the field values
%field1Values = data.Field1;
% Plot the data
plot(data);
I see great promise in AI Chat.
Opie
Kali
Kali
Last activity 2023-12-21

Write a matlab script that will print the odd numbers, 1 through 20, in reverse.
I cannot figure out how to do this correctly, please help.
I saw this post on Answers.
I was impressed at the capability of the AI, as I have been at other times when I posed a question to it, at least some of the time. So much so that I wondered...
What if the AI were automatically applied to EVERY question on Answers? Would that be a good or bad thing? For example, suppose the AI automatically offers an answer to every question as soon as it gets posted? Of course, users would still be allowed to post their own, possibly better answers. But would it tend to disincentivise individuals from ansering questions?
Perhaps as bad, would it push Answers into the mode of a homework solving forum? Since if every homework question gets a possibly pretty good automatic AI generated solution, then every student will just post all HW questions, and the forum would quickly become overwhelmed.
I suppose one idea could be to set up the AI to post an answer to all un-answered questions that are at least one month old. Then students would not gain by posting their homework.
The MATLAB AI Chat Playground is open to everyone!
Check it out here on the community: https://www.mathworks.com/matlabcentral/playground
MATLAB AI Chat Playground Screenshot
I just published a blog post announcing the release.
Thats the task:
Given a square cell array:
x = {'01', '56'; '234', '789'};
return a single character array:
y = '0123456789'
I wrote a code that passes Test 1 and 2 and one that passes Test 3 but I'm searching a condition so that the code for Test 3 runs when the cell array only contains letters and the one for Test 1 and 2 in every other case. Can somebody help me?
This is my code:
y = []
[a,b]=size(x)
%%TEST 3
delimiter=zeros(1,a)
delimiter(end)=1
delimiter=repmat(delimiter,1,b)
delimiter(end)=''
delimiter=string(delimiter)
y=[]
for i=1:a*b
y = string([y x(i)])
end
y=join(y,delimiter)
y=erase(y,'0')
y=regexprep(y,'1',' ')
%%TEST 1+2
for i=1:a*b
y = string([y x(i)])
y=join(y)
end
y=erase(y,' ' )
That's the question: Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them comprise sides of a right-angled triangle. Return true if they do, otherwise return false .
I wrote this code but it doesn't pass test 7. I don't really understand why it isn't working. Can somebody help me?
function flag = isTherePythagoreanTriple(a, b, c, d)
a2=a^2
b2=b^2
c2=c^2
d2=d^2
format shortG
if a2+b2==c2
flag=true
else if a2+b2==d2
flag=true
else if a2+c2==d2
flag=true
else if c2+b2==d2
flag=true
else flag=false
end
end
end
end
end
That's the question:
The file cars.mat contains a table named cars with variables Model, MPG, Horsepower, Weight, and Acceleration for several classic cars.
Load the MAT-file. Given an integer N, calculate the output variable mpg.
Output mpg should contain the MPG of the top N lightest cars (by Weight) in a column vector.
I wrote this code and the resulting column vector has the right values but it doesn't pass the tests. What's wrong?
function mpg = sort_cars(N)
load cars.mat
sorted=sortrows(cars,4)
mpg = sorted(1:N,2)
end
I recently have found that I am no longer able to give my difficulty rating for questions on Cody after sucessfully completing a question. This is obviously not a big deal, I was just wondering if this was an issue on my end or if there was some change that I was not aware of.
The option to rate does not pop up after solving a problem, and the rating in general does not even show up anymore when answering questions (though it is visible from problem groups).
When solving problems over on Cody, I can almost always view all solutions to a problem after submitting a correct solution of my own. Very rarely, however, this is not the case, and I instead get the following message:
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
You may solve another problem from Community group to unlock all the solutions to this problem.
If this happens, then again, I can almost always rectify this by submitting a (correct) solution to a different problem (I take it that the Community group is the implicit group of all problems on Cody --- is it?). But sometimes that, too, fails.
So my question is, why? What are the criteria that determine when all solutions are, in fact, unlocked?
(There is a related question here, but I feel the posted answer does not answer the question.)
Simple question: I noticed there's a Modeling & Simulation Challenge Master badge over on Cody, but I can't find the corresponding group. So: where is it? Does it still exist at all?
Error: The server timed out while running and assessing your solution in MATLAB CODY. How do I resolve this? My code is correct. I have run it on PC. But, when i submit in CODY the server throws an error.