Answered
Concatenating elements of vectros without loops
x = [1 2 3]; y = [5 10]; [xx,yy] = meshgrid(x,y); z = [xx(:) yy(:)]

4 years ago | 0

| accepted

Answered
Arrayfun with multiple variable?
Two inputs: A=arrayfun(@(x,y)functionExample(x,y), input1, input2); Three inputs: A=arrayfun(@(x,y,z)functionExampl...

4 years ago | 0

Answered
angle and abs function gives me 'Subscript indices must either be real positive integers or logicals.' error
Do you have a variable called abs? To find out, do: whos abs If there is one, clear it by doing: clear abs This will clear t...

4 years ago | 1

Answered
Unrecognized function or variable
If the intent is that the local functions defined in the scripts accc.m and comple.m (those local functions being acav, sigmap, ...

4 years ago | 0

| accepted

Answered
Output cell values and column number for matrix with specific values
A = [1 128 1 0 0 0 0 0 0 0 0 0 0 1 129 0 1 1 1 0 1 1 0 0 0 1 1 130 1 0 1 0 0 0 0 1 0 0 0 1 149 0 0 0 0 1 0 1 1...

4 years ago | 0

Answered
How to put array in a cell of different groups ?
A = [ 70; 63; 105; 95; 128; 123; 137; 132; 142; 143; 154; 154; 160; 143 ]; B_wanted = { [ 70; 63 ] [ 105; 95 ] [ 128; 123 ] [ ...

4 years ago | 0

| accepted

Answered
How to run randperm command for 100 times and store these permutations
To save each permutation, assign it to a row or column of k, instead of overwriting k each time. You've set up k to have 10 row...

4 years ago | 0

| accepted

Answered
Connect points in two added variable plots of linear regressions
Use the output from plotAdded, which is the plotted lines. Get the first line's (data line) XData and YData for each model, and ...

4 years ago | 0

| accepted

Answered
Help plotting user input functions for Matlab App.
The reason using 'x' works is because 'x' is a valid line marker, so MATLAB plots x = -10:0.1:10 against its indices, 1:201 (not...

4 years ago | 1

| accepted

Answered
how should i fix the problem :Index exceeds the number of array elements (4).
I don't get that error (or any other errors) when I run it: clear;clc; im=imread('unnamed.jpg'); im_1 = double(im); R=im_1(:...

4 years ago | 0

Answered
Interpolating a set of values
The problem is that xlsread returns a matrix with some NaNs since the data columns in the xlsx file do not all have the same amo...

4 years ago | 1

Answered
scroll bar does not work when dialog box appears in app designer
inputdlg creates a modal dialog box. "Modal" means that no other window can be interacted with while the modal window is up. To...

4 years ago | 0

| accepted

Answered
graph did not plot, how to plot ?
When I call the function, it plots: % call the function vdpd_qo_syn: vdpd_qo_syn() % define the function vdpd_qo_syn: functi...

4 years ago | 0

Answered
2 sets of x,y variables, one changing loop, one set, how to plot them and update plot to have both
Setting the XData and YData of the line that should change is perfectly good way to update what needs updating (and avoid updati...

4 years ago | 1

| accepted

Answered
Comparing Strings and Finding Differencies
Your calculation of the positions of mutations pos_mut is ok, but it should be done only after result is completely determined; ...

4 years ago | 1

| accepted

Answered
I have data in seconds of each year, how to make continuous data for few years to plot as variable (Vx, Vy) Vs year
data = readmatrix('Ask.txt'); t = datetime(data(:,1),1,1) + seconds(data(:,2)); disp(t); % big jump from 01-Jan-2009 06:20:00 ...

4 years ago | 1

Answered
How to remove extra value from histogram In MATLAB
You can't change the 'Values' property of a histogram directly, but you can change its underlying 'Data'. In this case, you can ...

4 years ago | 0

Answered
while writing txt file variables/data are shown in one column instead of being different column
When you fprintf a matrix, MATLAB prints the elements in order of: first column first, followed by the second column, and so on:...

4 years ago | 0

Answered
Sorting the vector y wrt the vector x?
x = [ 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.66 ]; y = [ 0...

4 years ago | 1

| accepted

Answered
How te delete certain coulmns from a table with respect to the header
I'm unable to create a table with more than one column called 'AA' AA = [1; 3; 4; 0]; B = [1; 0; 5; 2]; table(AA,B,AA) So I'...

4 years ago | 0

Answered
I am graphing a function, and it is graphing more sin/cos waves then it is supposed to
Use cosd and sind when the angle is in degrees. cos and sin are for when the angle is in radians. theta = 0:180; L = 1; x = L...

4 years ago | 0

| accepted

Answered
How to move quiver arrows within the semi-circle
It's not clear how you determine where the quivers start, i.e., where the 'base' of each one (not the arrow end - the other end)...

4 years ago | 0

| accepted

Answered
How to insert values in a zeros matrix?
all_lat = -89.75:0.25:90; % according to the longitudes specified for India (66.5 to 100), % longitude goes from -180 to 180,...

4 years ago | 0

Answered
How to make time string from seconds of each year (total 11 years) to year (for 11 years)
dt = datetime('2008-01-01 00:00:00'):minutes(5):datetime('2019-12-31 23:55:00'); dt(1:10).' dt(end-9:end).'

4 years ago | 1

| accepted

Answered
my code is getting the sum of all the numbers under the positive numbers and not letting the negative numbers get summed separately.
Notice that you are checking whether n, the number of numbers, is positive or negative: if n > 0 positive_num = positive_n...

4 years ago | 0

Answered
Creating an array for a set number iterations
F = 100000; for i = 1:30 Ct = F*0.04.*ones(i,1); Ct(i) = Ct(i)+F end

4 years ago | 0

| accepted

Answered
extracting the location of the two largest peaks
% some signal Y Y = sin(0:0.01:12*pi); Y = Y+0.2*randn(size(Y)); plot(Y) [pks,locs] = findpeaks(Y); [pki,loci] = maxk(pks...

4 years ago | 0

| accepted

Answered
Why is my 'n' only 1?
My guess is that this line: peak_CADO_DPCPX = min(new_files(:,peak_point_B)); % peak_point_B for all files should be this: pe...

4 years ago | 0

Answered
How can I plot this figure?
You could use create patch objects instead of rectangle objects, and then make a legend from (some of) those patches. Or you ca...

4 years ago | 0

| accepted

Answered
Colormap map to Y axis instead of Z
You can use the fourth input to surf to set the color to something other than Z. In this case set the color to be the same as Y:...

4 years ago | 0

| accepted

Load more