MATLAB Central Discussions - Join the conversation!
メインコンテンツ

結果:


Bewar Yousif Ali
Bewar Yousif Ali
最後のアクティビティ: 2024 年 2 月 7 日

It is crucial to understand that this expression could be used in problems related to engineering, physics, mathematics, or any other aspect of real life.
Typically, Matlab is used to solve PDE and ODE problems. Perhaps users calculated this term 0^0 incorrectly in the process.
>> % Reviewed by Bewar Yousif Ali
>> % How to fix this problem 0^0 in Matlab !?
>> % Mathematically, x^0=1 if x≠0 is equal 1 else undefined(NaN)
>> 0^0
ans =
1
>> f=@(x,y) x^y;
>> f(0,0)
ans =
1
>> v=[2 0 5 -1];
>> v.^0
ans =
1 1 1 1
Chen Lin
Chen Lin
最後のアクティビティ: 2023 年 12 月 30 日

What amazing animations can be created with no more than 2000 characters of MATLAB code? Check out our GALLERY from the MATLAB Flipbook Mini Hack contest.
Vote on your favorite animations before Dec. 3rd. We will give out MATLAB T-shirts to 10 lucky voters!
Tips: the more you vote, the higher your chance to win.
i=dsolve('Dy=-8*y+40*sin(8*t)','y(0)=5')
Warning: Support for character vector or string inputs will be
removed in a future release. Instead, use syms to declare
variables and replace inputs such as dsolve('Dy = -3*y') with syms
y(t); dsolve(diff(y,t) == -3*y). > In dsolve (line 126)
Andrea Lanza
Andrea Lanza
最後のアクティビティ: 2023 年 11 月 27 日

Hi all, I have to train a one class SVM for anomaly detection. I have a dataset with two features. I trained the model on normal instances with ocsvm function. What I don't understand are the contour lines for the ocsvm scores... I do not expect those to be like that. In the figure are represented the normal instances in the space (feature1, feature2) and the contour lines corresponding to some values of ocsvm score. They are simply absurd, not like the example see on the matlab guide. I would expect ellipsoidal contour lines, not these! Any help? Thank you!
Perky Whale
Perky Whale
最後のアクティビティ: 2023 年 11 月 27 日

I have a few ESP8266 running various sensor tasks, and sending GET or POST requests to Thingspeak via api.thingspeak.com. They all connect to the household router.
Recently, I became aware of a problem with the devices occasionally timing out when trying to communicate with Thingspeak. For example, here's a bit of code from a basic water level sensor:
String url = "http://api.thingspeak.com/update?api_key=xxxxxxxxxxxxx&field1=";
url += getdistance();
url += "&field8=";
url += batt;
http.begin(client, url);
int httpcode = http.GET();
Serial.println(httpcode);
String payload = http.getString();
Serial.println(payload);
http.end();
Fairly often, the connection will fail with a -1 httpcode. Sometimes it will run for weeks with no issues and then suddenly stop connecting. If I type the URL in a browser, it will always work immediately. If I connect the ESP to a mobile hotspot, it will also connect immediately with no issues. I can't find any issues at all with the router, and I've fully reset it etc. I've also confirmed the wifi connection between ESP and router is not the problem.
Sometimes one ESP will be running fine, and another will be having connection issues. The next day, the first one will have issues and the other will be fine.
So I added a bit of code to see if I could time the connection:
server = "api.thingspeak.com"
timer= millis();
while(client.connect(server,80)){
delay(10)}
t=millis()-timer;
Serial.print(t);
The devices now connect every time. But the connection can take up to 180 seconds. Some ESP's updating to older channels are much more reliable and connect within a second or two; it seems as though the more recently created channels take longer to connect to.
I'm reaching out here because I can't really think of where to begin trying to fix this. Why does a browser succeed immediately updating a channel with the api.thingspeak url but the ESP takes up to 180 seconds? Why do I not have any problems connecting the ESP via a mobile hotspot? Why does the same device work for weeks then suddenly play up?
I think I've isolated the problem to either the router or the thingspeak api, and I can't find anything wrong with the router.
Might be worth noting that I have an ESP in a heat pump which updates every 15 seconds to thingspeak by MQTT and it hasn't skipped a beat in months so maybe I should upgrade them all to MQTT.
Is the api just that flakey?
JAMEEL
JAMEEL
最後のアクティビティ: 2024 年 2 月 6 日

% Given data
x = [2.0, 3.0, 6.5, 8.0, 12, 15];
f = [14, 20, 17, 16, 23, 125];
% Construct the cubic spline
h = diff(x);
A = zeros(length(x)-2);
for i = 1:length(x)-2
A(i,i) = 2*h(i) + 2*h(i+1);
A(i,i+1) = h(i+1);
A(i+1,i) = h(i);
A(i+1,i+1) = 2*h(i) + h(i+1);
end
b = [6*(f(2)-f(1))/h(1) + 6*(f(3)-f(2))/h(2);
6*(f(4)-f(3))/h(3) + 6*(f(5)-f(4))/h(4)];
M = A\b;
% Evaluate the second derivative at data points
d2f_dx2 = zeros(length(x),1);
for i = 1:length(x)-2
d2f_dx2(i) = M(i);
d2f_dx2(i+1) = M(i) + h(i)*M(i+1);
d2f_dx2(i+2) = M(i) + 2*h(i)*M(i+1) + h(i)*h(i)*M(i+2);
end
% Display second derivatives at data points
disp('Second Derivatives at Data Points:');
disp(d2f_dx2);
Sanika Patil
Sanika Patil
最後のアクティビティ: 2024 年 2 月 19 日

Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback Error while evaluating Button PrivateButtonPushedFcn.
help to solve this error in face recognition GUI
Shiwani
Shiwani
最後のアクティビティ: 2023 年 11 月 27 日

Hi I have a user defined blocks for my Simulink but whenever I add path of user defined, the error pops up stating I dont have stateflow.
Can anyone please guide me through it.
지웅
지웅
最後のアクティビティ: 2023 年 11 月 27 日

Hello! I am wondering if it is possible to connect ls-dyna to matlab so that when i enter the parameters on matlab, ls-dyna reads the parameter from and runs the simulation and sends the result to matlab.
let me know if there's any more info needed, good solution or whether it is even possible
i've finished writing the code for my ~masterpiece~ and it doesn't run on the contest new entry page. it runs on matlab on my desktop and in the matlab live editor in my browser, but not where i really need it to. usually it'll draw the first frame the first time i run the code in a new window, but not any subsequent times. whether i hit "run" or "create animation", the screen grays out as it's supposed to, but then returns to normal without generating the first frame or animation.
i'm not getting a timeout warning or any error messages. i timed the code on my laptop and it takes about 100ish seconds to run and generate the animation the first time i run it before clearing everything from my workspace (and then it takes about twice as long each subsequent time, which makes me a bit nervous. can't figure out why this is the case at all!), which is well within the 255 second limit for the contest. as far as i know, the most computationally expensive function i'm using is patch(). i'm pretty close to the character limit, but i don't know if that's part of the problem.
i tried vectorizing some of the code instead of using for loops, which made the code run slightly slower. i tried using a nested function instead of using drawframe() and an auxiliary function, but that didn't help. i tried clearing all variables except f at the end of drawframe() to no avail. i tried using the close command at the start of drawframe(), with similar success. i updated chrome, closed a bunch of windows, tried safari, used my sister's laptop, all with no luck.
has anyone else had this or a similar problem? any advice?
thanks!
David
David
最後のアクティビティ: 2023 年 12 月 27 日

Farzad
Farzad
最後のアクティビティ: 2023 年 11 月 27 日

Dear all,
I would like to know if "Ridge regularization, i.e., L2" is applicable to the LSBoost regression model or not. After searching the MATLAB documentation, I found code only for "Lasso (L1) regularization."
For example:
t = templateTree(Reproducible=true);
bag = fitrensemble(X,Y,Method="Bag",NumLearningCycles=300,Learners=t);
bag = regularize(bag,Lambda=[0.001 0.1],Verbose=1);
Best regards,
Alessio
Alessio
最後のアクティビティ: 2023 年 11 月 22 日

Hello, I have applied the "sobel" edge detection function. However, I am not sure how to segment and single out only the cells that contain the " cross" shape inside of them. These are the cells infected by Babesisos, while the rest are not infected.
Thanks !
Hello everyone,
I am trying to simulate the trajectory of a two-stage rocket in Simulink. I am using the 'Custom Variable Mass 6DOF ECEF (Quaternion) Equation of Motion'. I would like to use a PID controller to control the pitch angle of the rocket (note, pitch angle is the output). The issue is that the above Equation of Motion is non-linear. Is there a way to linearize this EOM for the entire trajectory? the system is time dependent ( as the mass, velocity and trajectory changes with time).
link of the EoM:
https://nl.mathworks.com/help/aeroblks/customvariablemass6dofecefquaternion.html
Proxy
Proxy
最後のアクティビティ: 2023 年 11 月 22 日

hi
I have a problem when offline installing the support packages for the zynq on matlab r2019a.
I obtain the following error message:
"Support Software Installer Error
System does not have the required MATLAB version to start the support package installation."
I tried different versions, uninstall/re-install matlab, different ways for installing this package and it does not work
Do you have any suggestions
Chen Lin
Chen Lin
最後のアクティビティ: 2023 年 12 月 11 日

Just in two weeks, we already have 300 entries and 2,000 votes! We are so impressed by your creative styles, artistic talents, and ingenious programming techniques.
Now, it’s time to announce the weekly winners!
Mini Hack Winners - Week 2
Time & Space:
Trees:
Cartoon:
Symbolism:
Realism:
Fractal:
Multi-Entry Stories:
Explanatory:
Light:
MATtropolis:
Congratulations! Each of you won your choice of a T-shirt, a hat, or a coffee mug. We will contact you after the contest ends.
New categories for Week 3!
  • 40: MathWorks will celebrate its 40th Anniversary in 2024. You will have opportunities to win special prizes!
  • Most creative remix
Categories we’d love to see more entries in
Finally, just a reminder that you have a direct impact on the next generation of animation tools in MATLAB! Don’t forget to share your thoughts and ideas with us.
Shaunak Deshpande
Shaunak Deshpande
最後のアクティビティ: 2024 年 2 月 7 日

I'm getting an error error "using tall/cellfun" while doing a project listed in mathworks "Denoise Speech Using Deep Learning Networks". I don't know how to fix this error pr why this error occured in the first place. Seeking explanation for this particuar error. If you know anuthing about it then please consider helping me below this post.
Elija
Elija
最後のアクティビティ: 2025 年 2 月 3 日

Hello, all!
This is my first post after just joining this discussion, so please forgive me and provide kind assistance if I have posted to the wrong subsection!
I have a good interest in learning sql server course and right now I am taking help from various platforms like https://www.coursera.org/ https://www.udemy.com/
Also I have a doubt that is it a good option to learn from platforms like this or I should go for some sql server online training . I have searched for the solution of my queries in various above platforms which helped me up to some extent only as it was not directly given by any expert or trainer.
Hoping in getting a quick response
Thankyou in advance.
Adrian Segura
Adrian Segura
最後のアクティビティ: 2023 年 11 月 28 日

Hello, I am a student and I am working on a neural network for a line follower car and I would like you to recommend a tutorial to implement it in simulink.
Lu
Lu
最後のアクティビティ: 2023 年 11 月 22 日

Hello, everyone.
I have got the x,y,z coordinates and MagE for a radiation pattern. But when I want to plot it in spherical coordinates using 'patternCustom' function, I found the pattern is incomplete.
I attaced the data and script here. Can someone help me?
Go to top of page