Answered
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...

4 years ago | 0

Answered
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.

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

Answered
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

4 years ago | 0

| accepted

Answered
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...

4 years ago | 2

| accepted

Answered
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=...

4 years ago | 0

Answered
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 ...

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 1

| accepted

Answered
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 ...

4 years ago | 2

Answered
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...

4 years ago | 0

Answered
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

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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. ...

4 years ago | 0

Answered
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...

4 years ago | 3

| accepted

Answered
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...

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 1

Answered
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 ...

4 years ago | 0

| accepted

Answered
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...

4 years ago | 1

Answered
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. ...

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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(:)).'...

4 years ago | 0

Answered
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...

4 years ago | 0

| accepted

Answered
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 =...

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
Combining 3 3D matrices
Use cat: A=rand(313,409,31); B=rand(313,409,28); C=rand(313,409,30); total=cat(3,A,B,C); size(total)

4 years ago | 1

| accepted

Load more