Answered
plotting of mean function of exponential random variables
The plot created by histogram has count on the y axis by default. If you would like the y axis to instead give probability, you ...

5 years ago | 0

Answered
how to change axis fort size
By setting the 'FontSize' property of your axes. For example, if the axes handle is contained in ax, you can use ax.FontSize = ...

5 years ago | 0

Answered
Error Using audioread : Expected input number 2, range, to be positive.
audioRead() requires that the second input contains two positive integers. I would guess, based on the code and the error, that ...

5 years ago | 0

| accepted

Answered
Add new DropDown item in App designer 2019a
This will add the edit text's string to the drop down's list of items as long as it is not already there: function EditFieldVal...

5 years ago | 2

| accepted

Answered
Using inputdlg and isnan
In your code, NOF never changes inside the loop. Therefore, if the loop enters, it won't ever exit because the exit condition wi...

5 years ago | 1

| accepted

Answered
how to plot data from a cell array that the numbers are type string?
Note that str2double for the character vectors you have returns NaN: >> str2double(' 6 . 6 0 0 0 0 4 e - 0 7 ') ans = ...

5 years ago | 1

Answered
peaks of plot in UIAxes appdesigner opening in another window
Problem According to the docs for findpeaks, a plot will be generated as long as no outputs are requested. After messing around...

5 years ago | 1

| accepted

Answered
Plotting multiple y axes on one side only using addaxis
It looks like that function flips back and forth between adding the new axes to the left and adding them to the right. How about...

5 years ago | 0

Answered
How can I extract from Matlab two vector with diferrent dimension in to the same excel page without having to create different sheets
One option, which leaves a blank column between the two sets: T2 = table(X2(:), Y2(:)); writetable(T2, fileName, 'Range', 'D1'...

5 years ago | 1

| accepted

Answered
Error using textscan Invalid file identifier Use fopen to generate a valid file identifier in app designer
It doesn't seem like your upload button stores anything. It saves the file and path into file and path and then exits, at which ...

5 years ago | 2

| accepted

Answered
Expand matrix pattern by rows only
You can give multiple dimensions to repmat: repmat(x,1,365)

5 years ago | 0

| accepted

Answered
Is it possible to use outcomes of functions in another script, without running that function first?
You can call your first function in your second function like so: function [Outcome1, Outcome2] = advanced(x,y) [Alpha, Beta, ...

5 years ago | 0

| accepted

Answered
How to draw a number of line in a unit cell
Use theta(i) to access the ith angle from your array theta. Also, there is no need to store line positions in x(i+1) and y(i+1) ...

5 years ago | 0

| accepted

Answered
Matlab is calculating standard deviation wrongly
std calculates the sample standard deviation: >> sqrt(((-3)^2 + (0)^2 + (3)^2)/(2)) ans = 3 . sqrt(6) would be the ...

5 years ago | 0

Answered
Iterate through indexes creating a new matrix
Try this: i = 1:size(C,1); D = C(any(i>=A & i<=B),1); Works with the following simple arrays, but let me know if it doesn't w...

5 years ago | 0

| accepted

Answered
Adding axes to histogram on scatterhist, and changing graph area
How about something like this? figure(3) h = scatterhist(rand(100,1), rand(100,1),'Marker','.','MarkerSize',10,'Color','k','NB...

5 years ago | 2

| accepted

Answered
The logical indices in position 1 contain a true value outside of the array bounds.
For the following sample array, >> A = randi(5, 5, 5) A = 3 1 5 2 4 2 2 4 3 2 ...

5 years ago | 0

Answered
Error using matlab.graphics.Graphics/set The name 'handlevisibility' is not an accessible property for an instance of class 'matlab.graphics.GraphicsPlaceholder'.
Similar to how a(3) = true fills a(1) and a(2) with false, your SkMp.uic3 (which is a 4x9 Graphics array) fills empty values w...

5 years ago | 0

Answered
Rotate a spot in a binary image by 45/-45 degree
Quick note: I started working on this, then stepped away for a bit, then came back and finished. Despite ImageAnalyst's great an...

5 years ago | 0

| accepted

Answered
Compare positions of strings in two cell arrays having the same string elements
F1 = {'ETA.csv', 'GAMMA_P.csv', 'MAG.csv', 'parameters.csv', 'PRESSURE.csv', 'shearhistogram.csv'}; F2 = {'PRESSURE.csv', 'ETA....

5 years ago | 1

| accepted

Answered
need some help matlab code has an error
(1) Use B where you have b. (2) Change fprint to fprintf. A = [6 2 1 1;2 7 1 2;3 2 8 1;1 2 6 9]; B = [6;4;5;3]; maxitr = 100...

5 years ago | 0

Answered
How to use structure variable names in for loop
Loop through the structures instead of their names: Structure={A,B,C,..,n}; for i=1:numel(Structure) output= Structure{i}.fie...

5 years ago | 0

| accepted

Answered
how to extract and use the uicontrol from an cell array
Indexing into a cell array with ( ) gives you another cell array. Use { } instead to access the data inside that cell array: fo...

5 years ago | 0

| accepted

Answered
How do i read the exact values from a textfile
fileread is reading each character from the file. If you want to interpret those characters as numbers, one option is to use tex...

5 years ago | 0

Answered
Calculating percent of data in table
For the following table: T = table; T.data = randi(10,1,12); you can use: T.percentages = 100 * T.data ./ sum(T.data); whic...

5 years ago | 2

| accepted

Answered
Write function with multiple output, like sort()
function [out1, out2, out3] = myfunc ... end As an example, this function has 3 outputs. You can call it with [a, b, c] ...

5 years ago | 2

| accepted

Answered
The following Matlab code runs only half of the for loop. Can anyone help me figure out the problem?
PayloadBits((ind*MSDU*NumDataCarriers)+1:(NumDataCarriers*MSDU)*(ind+1),:)=[]; This line changes the size of PayloadBits, but y...

5 years ago | 0

| accepted

Answered
A method to control on a certain variable n is present in a column (left or right) of a matrix
Possibly this? >> any(Edge==2) ans = 1×2 logical array 1 1 % 2 is present in both >> any(Edge==1) ans = ...

5 years ago | 1

| accepted

Answered
Force element access inside for loop
Is p a column vector? Notice the difference between the following: >> for i = 1:3 disp('a') end a a a and >> for i ...

5 years ago | 0

| accepted

Answered
Index occurences of number combinations in a table
How about this? T = table; T.A = [1;2;3;3;3;4;4;4;5;5;5;6;6;6]; T.B = [1;1;1;4;5;1;4;5;1;4;5;1;4;5]; idx = splitapply(@(a) a...

5 years ago | 0

Load more