Pull up a chair!

Discussions is your place to get to know your peers, tackle the bigger challenges together, and have fun along the way.

  • Want to see the latest updates? Follow the Highlights!
  • Looking for techniques improve your MATLAB or Simulink skills? Tips & Tricks has you covered!
  • Sharing the perfect math joke, pun, or meme? Look no further than Fun!
  • Think there's a channel we need? Tell us more in Ideas


I'm getting an error error "using tall/cellfun" while doing a project listed in bat365 "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.
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.
柯

Posted about 22 hours ago

Hello, I want to use a solenoid valve to open and close the two-phase flow circuit, and I should use those elements to achieve it.
Adrian Segura
Adrian Segura
Posted on 19 Nov 2023 at 16: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
Posted on 19 Nov 2023 at 14:20

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?
a = 0; % lower limit
b = 1; % upper limit
exact_integral = log(2); % Exact integral value
f = @(x) 1/(1+(x.^2));
fprintf('Integration of x*sqrt(1-x^2) from %d to %d:\n\n', a, b);
% Initialize arrays to store data for the log-log plot
N_values = [];
relative_precision_simpson = [];
fprintf('%-20s %-20s %-20s\n', 'N', 'Extended Simpson', 'Relative Precision');
for N = 2:20
SN = extended_simpson(f, a, b, N);
relative_precision_simpson = [relative_precision_simpson, abs((SN - exact_integral)/exact_integral)];
fprintf('%-20d %-20e %-20e\n', N, SN, abs((SN - exact_integral)/exact_integral));
N_values = [N_values, N];
end
loglog(N_values, relative_precision_simpson, '-o');
xlabel('Number of Sub-intervals (N)');
ylabel('Relative Precision');
legend('Extended Simpson');
title('Log-log Plot of Relative Precision vs Number of Sub-intervals');
grid on;
function S2N = extended_simpson(func, a, b, n)
if n < 0
error('Negative n in extended_simpson');
elseif n == 0
S2N = (b - a) * (feval(func, a) + 4 * feval(func, (a + b) / 2) + feval(func, b)) / 6;
else
h = (b - a) / 2^n; % initial step size
x_vals = a:h:b; % partition points
S2N = feval(func, a) + feval(func, b);
for i = 1:(2^n - 1)
x = x_vals(i);
if mod(i,2) == 0
S2N = S2N + 4 * feval(func, x);
else
S2N = S2N + 2 * feval(func, x);
end
end
S2N = h / 3 * S2N;
end
end
The code above shows a upward trend for the Simpson's rule with the given function. However, it should show a downward trend for the relative precision. What could be the problem here?

Greetings great community I need help with 2D or 3D grid formation in MATLAB and how to assign charge particles on each cell that constitutes the entire grid

MOHAMED
MOHAMED
Posted on 17 Nov 2023 at 20:06

Hello everyone !!!!
I try to develop a test bench for cybersecurity in micro grids (Generations, Breakers,...) . I plan to simulate my grid on Simpower. I have a simulated PLC in a VM and a real RTAC. I would like to establish bidirectional communication between my grid simulated on Simpower and the physical RTAC (or the simulated PLC on VM). The RTAC is connected to a SCADA system which should be able to send commands to the grid (Simpower).
RTAC, Simpower, and the SCADA system are located on separate machines.
Any approach to establish a connection between Simpower and the RTAC (or PLC)?
Thanks !!!
I think it would be a really great feature to be able to add an Alpha property to the basic "Line" class in MATLAB plots. I know that I have previously had to resort to using Patch to be able to plot semitransparent lines, but there are also so many other functions that rely on the "Line" class.
For example, if you want to make a scatter plot from a table with things specified into groups, you can use ScatterHistogram or gscatter but since gscatter uses the Line class, you can't adjust the marker transparency. So if you don't want the histograms, you are stuck with manually separating it and using scatter with hold on.
Vinay Ramesh
Vinay Ramesh
Posted on 14 Nov 2023 at 16:35

Dedicated to all Flipbook contest lovers! :D
Hello everyone! I'm new in MatLAB and i get confusing because i cannot run my program.
set(handles.ik5,'string',ik5);
set(handles.es5,'string',es5);
set(handles.el5,'string',el5);
-------------------------------------------------
Undefined variable "handles" or class "handles.ik5".
Error in Untitled (line 4)
set(handles.ik5,'string',ik5);
Hi, I'm in truble because I have two programs with the same variables and parameters. The main of the study is to change a value and plot the results. The problem is that I want them on the same plot but I use the same name for the variabes in the two different programs so when I use some function to join the figures togheter matlab resets the values obtained in the first program and runs only the second one.
Is there a method to avoid changing all the names of the variables in one of the two programs (because they have something like 500 lines)?
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.
Josh
Josh
Posted on 13 Nov 2023 at 14:59

Loving all the animations I'm seeing so far and feeling so inspired and impressed by what y'all are sharing. Thanks for loading me up with new topics to learn about!
Hi everyone,
I would like to ask you if it would be possible to do an HiL simulation using an environment model simulated via Simulink and load in a target computer connected to the hardware needed. The target computer will be simply a laptop with Matlab&Simulink package installed and directly connected to the bench to test.
I have found some solutions about the use of Simulink Real-Time but it implies the use of a Speedgoat unit, so I was wondering if anyone has ever done it without that device.
Thank you very much.
Hi Guys
Posting this based on a thought I had, so I don't really ahve any code however I would like to know if the thought process is correct and/or relatively accurate.
Consider a simple spring mass system which only allows compression on the spring however when there is tension the mass should move without the effect of the spring distrupting it, thus the mass is just thrown vertically upwards.
The idea which I came up with for such a system is to have two sets of dfferential equations, one which represents the spring system and another which presents a mass in motion without the effects of the spring.
Please refer to the below basic outline of the code which I am proposing. I believe that this may produce relatively decent results. The code essentially checks if there is tension in the system if there is it then takes the last values from the spring mass differential equation and uses it as initial conditions for the differential equation with the mass moving wothout the effects of the spring, this process works in reverse also. The error which would exist is that the initial conditions applied to the system would include effects of the spring. Would there be a better way to code such behaviour?
function xp = statespace(t,x,f,c,k,m)
if (k*x(1)) positive #implying tension
**Use last time step as initial conditions**
**differential equation of a mass moving""
end
if x(1) negative #implying that the mass in now moving down therefore compression in spring
**Use last time step as initial conditions**
**differential equation for a spring mass system**
end
end
Hello,
I have an equation model following a law of type power: s=aN^b
For the measure equation, I have also a power law: m=cN^d
So I would like to have an extended Kalman Filter code in Matlab for this case. CAN YOU HELP ME PLEASE ?
Hello.
I use readgeoraster to read in a 25MB geotiff. I then turn around and immediately write out the data with geotiffwrite. The resultant file is now 250MB.
What is the explanation for this 10x increase in file size? The data read in are 'single' format. And that is the exact data I am writing out.
Dave
Seeing a colleague make this mistake (one I've had to fix multiple times in other's work too) makes me want to ask the community: would you like the awgn() function/blocks to give the option for creating a SNR at the bandwidth of the signal? Your typical flow is something like this:
  • Create a signal, usually at some nominal upsampling factor (e.g., 4) such that it's now nicely over sampled, especially if you're using a RRC or similar pulse shaping filter.
  • Potentially add a frequency offset (which might make the sample frequency even higher)
  • Add AWGN channel model for a desired SNR
  • Put this into your detector/receiver model
The problem is, when someone says, "I'm detecting XYZ at foo SNR," it should not magically improve as a function of the oversample. The problem isn't that awgn() generates white noise, that's what it's supposed to do and the typical receiver has noise across the entire band. The problem is that SNR is most properly defined as the signal power over the noise power spectral density times the signal's noise equivalent bandwidth. Now I looked and there's no handy function for computing NEBW for an input signal (there's just a function for assessing analysis windows). In practice it can get a bit tricky. The occupied bandwidth or HPBW are often close enough to the NEBW, we're usually not haggling over hundredths of a dB. So, in my not so humble opinion, the "measured" flag for awgn() should give an option for bandwidth matching or at least document the behavior better in the help page. All too often I'm seeing 3-6 (or worse) dB errors because people aren't taking the signal's bandwidth into account.