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

más de 4 años hace | 1

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

más de 4 años hace | 0

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

Respondida
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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 2

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 2

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

más de 4 años hace | 0

Respondida
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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 3

| aceptada

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 1

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 1

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 0

Cargar más