Risposto
Bringing arrays to the same length
There are two issues with the solution by Arif: It uses find on a logical array, but that is only used to index an array It as...

oltre 4 anni fa | 1

Risposto
How to generate dataset automatically using MATLAB
Maybe you want this? total_samples_per_class=5e5; prfSTG = [200 400 800 1000 900 ]; n_pulsesSTG = [800 800 800 800 800 80...

oltre 4 anni fa | 0

Risposto
I want to build aa matrix by choosing a random value of x1,x2 ... from -1to 1, 1000 times? Could anyone help?
Turn your numbered variables into an array. Then you can use randi to randomly select from those values.

oltre 4 anni fa | 0

| accettato

Risposto
How can I use Loop to read multiple matrixes and sum rows?
You can load the mat file to a struct and loop through the fields. Now you also immediately see why numbered variables are a bad...

oltre 4 anni fa | 0

| accettato

Risposto
Plotting Multiple Box plot in same graph same x axis
You can group them in bins from 1 to 15 and tweak the x labels to match your needs. See the documentation for how to use 'Group...

oltre 4 anni fa | 0

Risposto
How to list the directories of multiple folders?
base_path='C:\Users\Desktop\Stats\'; P=cell(5,1); for n=1:numel(P) P{n}=sprintf('%sID%03d_Stats',base_path,n); end P

oltre 4 anni fa | 0

| accettato

Risposto
Adding a progress bar in App Designer inside a callback
To increase performance, Matlab does not automatically update graphics elements on the screen after a function call that modifie...

oltre 4 anni fa | 2

| accettato

Risposto
How to get Matlab C++ compiler name in my program?
If starting Matlab is fine, then this code will get you all the info you need: details=get_cpp_compiler_info function details=...

oltre 4 anni fa | 0

Risposto
How can I find the line after the line containing the text I am looking for?
There are two general ways to this: Read the data all at once, then do your analysis on the full file, then write the complete ...

oltre 4 anni fa | 0

| accettato

Risposto
How to create GUI for Transmitting and receiving image using MATLAB
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread. As @Benjamin Thompson...

oltre 4 anni fa | 0

Risposto
coloration the pixels matlab
The easiest way to do this is to create an index image and then use ind2rgb to convert to a color image. im1=imread('https://ww...

oltre 4 anni fa | 0

Risposto
How do I solve this matrix in a loop for different values for P?
I'm guessing you want a for loop like this: x1= linspace(-0.005,0.005,10); x2= linspace(-0.005,0.005,10); x3= linspace(-0.005...

oltre 4 anni fa | 1

| accettato

Risposto
Guidelines for appropriate moderation?
Sorry, this post is not very structured, maybe I'll edit it if this thread gets more attention. What I personally tend to do ...

oltre 4 anni fa | 2

Risposto
How can we write unsigned long value in matlab?
As I understand it, this would be a casting operation, equivalent to the Matlab function cast. (note that typecast changes the d...

oltre 4 anni fa | 0

Risposto
What type of Build in function used for plot such graph? or how to plot such graph?
The plot3 function will do this. help plot3

oltre 4 anni fa | 0

| accettato

Risposto
Boxplot how to make the box widths proportional to sample size
There is no function in Matlab that does this natively, but you can write it from scratch. If it is important to you that you...

oltre 4 anni fa | 0

Risposto
How I can do auto-resized axes in App Designer?
You should confirm the units property of your axes is set to normalized. If this is not possible you will have to use a listener...

oltre 4 anni fa | 0

Risposto
How to curve fit an equation that gets values from another equation?
There is probably something wrong with your loop, as you're using e both in the first part as an array, and in the second part. ...

oltre 4 anni fa | 0

Risposto
Why two variables loading the same .mat file are not equal ?
I guess boldly: There might be a NaN value hidden somewhere in your data: isequal(NaN,NaN) You might be interested in my Comp...

oltre 4 anni fa | 3

| accettato

Risposto
Can I create function that use default input unless a user gives one?
The code you show is almost exactly what you describe (except for the <0 instead of <1): if the user doesn't provide an input, i...

oltre 4 anni fa | 0

| accettato

Risposto
how do i plot a straight line and also change then range of the x axis and y axis ?
I suspect you want something like xline or yline: Vonew=45; Vonew2=15 vin=30; y=Vonew; %i get my Voutnew=45 x=Vonew2; plot...

oltre 4 anni fa | 0

Risposto
Calculate min/max/mean value every 100 points
Reshape will work, but you have to pad with NaN values and set the 'omitnan' flag: data=rand(1,17999); data(end+(1:mod(-end,10...

oltre 4 anni fa | 1

Risposto
a length of number times to a function
Apparently conv(ecg,h) returns a vector, meaning that you can't store it in ye(i). My guess would be that you would be willing ...

oltre 4 anni fa | 0

| accettato

Risposto
Converting unix time to real time
I suspect you forgot to convert the char to a value: unix_time='1641031963.398125'; unix_time=str2double(unix_time); date_tim...

oltre 4 anni fa | 1

Risposto
Combining .txt files and averaging data
You can get my readfile function from the FEX. If you are using R2017a or later, you can also get it through the AddOn-manager. ...

oltre 4 anni fa | 0

Risposto
Assign a Sub Array to Array Knowing the Number of Dimensions at Run Time
There is probably a better way, but you can fill a cell array with the index vectors (simple loop with ndims), and then use this...

oltre 4 anni fa | 0

Risposto
I need create a function for order pairs
You can create indices with meshgrid or ndgrid, no loop needed. [indA,indB]=ndgrid(1:numel(A),1:numel(B)); C=[A(indA(:)).'...

oltre 4 anni fa | 0

Risposto
A Ghost Data In Matlab???
The way data is displayed and the way data is stored are separated in Matlab. If you take a look at this: [12345.1 2015] You w...

oltre 4 anni fa | 0

| accettato

Risposto
Plot a for-loop with if-statements inside
In this case you don't even need a loop: a = 1; b = 2; pv = 5*10^(-3); Q = pv*((4*pi*b^3)/3) - pv*((4*pi*a^3)/3); epsilon =...

oltre 4 anni fa | 0

Risposto
I am facing one problem.I am creating a GUI.I have a string in a m. file.I want to show that string in my GUI .How can I do that?
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread. The source of your e...

oltre 4 anni fa | 0

Carica altro