Respondida
How can I shade an area of my graph between two vertical lines?
iz=linspace(20,24,40); yz=pdf(pd,iz); area(iz,yz) <</matlabcentral/answers/uploaded_files/121187/untitled.jpg>>

más de 8 años hace | 2

| aceptada

Respondida
bar graph command for range values
if numtests > 1 figure1 = figure('Color',[1 1 1]); subplot(141); bar(ampsCAP(1,:)); title([int2str(Cs(1,1)) ' Hz']);...

más de 8 años hace | 0

| aceptada

Respondida
Subscript indices must either be real positive integers or logicals.
... normalize8=uint8(normalize); X1=normalize8(X)+0.01; %for the log operation ... You defined |normalize| as a fl...

más de 8 años hace | 0

| aceptada

Respondida
Adding duration in second as x axis
Don't alias the builtin |duration|; that _will_ create problems working with time objects. You don't really want a duration, ...

más de 8 años hace | 0

| aceptada

Respondida
how to create multiple axis at x axis on same time window? i have attached one image of that kind. Please help.
Start with |subplot| and mung on it a little... hSp(1)=subplot(3,1,1); % two subplots in space for th...

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 2

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 3

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 2

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 1

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 1

| aceptada

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

más de 8 años hace | 0

Cargar más