Answered
Adding more than one greater/less than condition to an 'if statement'
|inpolygon| can do it but you've then got to return both output variables and do the set difference between _in_ and _on_ to get...

8 years ago | 0

| accepted

Answered
How to continue running a script using a saved workspace
You'll have to fix your script such that you don't reallocate data arrays when restarting with a changed lower index of the |for...

8 years ago | 0

Answered
Bug on polyfit output?
"Feature" or "Quality of Implementation" depending on your viewpoint... help polyfit ... [p,S,mu] = polyfit(x,y,n...

8 years ago | 2

| accepted

Answered
How to find average of each column in every matrix within a cell
mn=cellfun(@mean,c,'uniform',0); % c is the cell array |mean| operates by column by default.

8 years ago | 0

| accepted

Answered
Compare each element of two matrices, and plot number of times the elements are equal.
>> h=histogram(A,edges) h = Histogram with properties: Data: [0.1000 0.2500 0.5730 0.6700 1.2800 0.2500 0...

8 years ago | 0

| accepted

Answered
Counting every single symbol in string
[c,~,idx]=unique(s); % unique elements, location in the string 's' n=histcounts(idx,numel(c)); % count how many of...

8 years ago | 0

Answered
Plot where x axis is the date
|xlim| works with |datetime| data as x-axis for current releases.

8 years ago | 0

Answered
How do I make a boxplot with double y-axis and 4 vectors?
Unfortunately, TMW didn't give the possibility of having _x_ locations for |boxplot| other than ordinal position of the columns ...

8 years ago | 3

| accepted

Answered
How to repeat function for different arrays?
If there are related variables which need similar operations, then don't create them as individually-named variables but as memb...

8 years ago | 0

Answered
solve equation by numerical method
_*Always*_ try to plot() something to see what you have... >> fnf = @(x3) 2*x3+(2^(1/2)*exp(-x3^2/2) + 2^(1/2))/(pi^(1/2)*e...

8 years ago | 0

| accepted

Answered
How to set the legend text align center?
No can do, sorry...

8 years ago | 0

Answered
Plot the second figure in the left corner
Very first example at <https://www.mathworks.com/help/matlab/ref/axes.html#buzt7yy-4 Axes> shows how.

8 years ago | 0

Answered
Save workspace output to a file
>> help save save Save workspace variables to file. save(FILENAME) stores all variables from the current workspace in ...

8 years ago | 0

Answered
Center and scale a fit
There's a 'Normalize','off'|'on' Name-Value Pair Argument in the |fitOptions| <https://www.mathworks.com/help/curvefit/fit.html?...

8 years ago | 2

| accepted

Answered
Matrix Loop and Labelling
You didn't supply an _x_ to PLOT() so it plots versus ordinal number... ... x=[0:N].'; % define range of x axis ...

8 years ago | 0

| accepted

Answered
how do I prevent bar3 shading the sides of the bars?
OK, I did figure out how to modify the .ZData values written to get the proper effect. ... for k = 1:length(b) zd=b...

8 years ago | 0

| accepted

Answered
Can I create an array of probability distribution objects?
I've got a lot else going on but caught just a few minutes last night -- haven't ever used the newer distribution objects much s...

8 years ago | 0

Answered
Do Matlabs 3D plots swap axes?
Not the way |meshgrid| is laid out -- look at a small enough space you can see it easily (and also not symmetric so can tell who...

8 years ago | 0

Answered
Get difference between array values
You can't store the difference from 1 to 0 in an unsigned integer; is there a reason you can't just use default double for |test...

8 years ago | 0

Answered
Yet another TEXTSCAN question...
Let |textscan| do the equivalent |strrep| for you... >> fmt1=repmat('%f',1,3); >> t=cell2mat(textscan(s,fmt1,'delim',','...

8 years ago | 1

Answered
y = imread(file1, 'BackgroundColor', [1 1 1]); WHAT DOES IT DO?
doc imread Read image from graphics file Syntax A = imread(filename) A = imread(filename,fmt) A = imread(__...

8 years ago | 0

Answered
How to delete/extract rows of data from file 1 based on what data appears in file 2?
A. in1=ismember(D1(:,2),D2(:,2)); % locations of D1 in D2 in2=ismember(D2(:,2),D1(:,2)); % vice versa D=[...

8 years ago | 0

| accepted

Answered
Adding an Extra Input Parameter to the Function
Since |sequentialfs| is a builtin Toolbox function, you'll really not want to mess with it directly; write a wrapper function ar...

8 years ago | 1

| accepted

Answered
How to Generate random number that most of them ZEROs
Well, if they're to be uniformly distributed then only 33% of them on average will be zero; that's what "uniform" means. You ...

8 years ago | 0

Answered
Use regular expression to extract a matrix from a file
>> fid=fopen('gabe.txt'); >> a=cell2mat(textscan(fid,repmat('%f',1,4),'headerlines',5,'collectoutput',1)) a = 1.0...

8 years ago | 0

| accepted

Answered
Plot with 2 corresponding x-axes
Basics aren't difficult; I'll have to consider precisely how to do the upper axis ticks; I've got another appointment in town sh...

8 years ago | 0

| accepted

Answered
explanation of logical condition?
size((A(k).cdata),1) --> number rows in kth element of struct array A field cdata size((A(k).cdata),2) --> number cols in...

8 years ago | 0

Answered
table / timetable - removing zero columns
Presuming since you're comparing all to zero, that all elements of the table are numeric, then simply pTable=primersTable(:...

8 years ago | 0

| accepted

Answered
Why FFT signal power is 3dB higher than definition
The normalization is all in your code-- P2 = abs(Y/N); P1 = P2(1:N/2+1); P1(2:end-1) = 2*P1(2:end-1); This is the ...

8 years ago | 0

| accepted

Answered
how to label x and y ticks?
You don't show the code to generate the plot, but ylim(ax1,[0 50]) ax1.Ytick=[1 10:50]) will work for the y-axes; of ...

8 years ago | 1

| accepted

Load more