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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 1

| aceptada

Respondida
Daily average precip for many years
Just taking a stab presuming the file is something recognizable-- precip=table2timetable(readtable('yourfile.ext')); % rea...

más de 8 años hace | 1

| aceptada

Respondida
i want to make the rows of some elements values empty and should be maintain the other row value
You can't make m(2,:) be four elements long while m(1) is 9 (or anything other than also four for that matter) as arrays must be...

más de 8 años hace | 0

| aceptada

Respondida
Is the anyone can explain this scaling function?
Well, we don't really either without what the handles.data.J are, but one can presume the |Position| variable is the axes _'Posi...

más de 8 años hace | 0

Respondida
How to adapt the space between the grid lines to the space between the ticks?
You have to address the proper axes object to change its properties...to make working with multiple axes easier, be absolutely s...

más de 8 años hace | 0

Respondida
How to get rid of the date on a plot over time?
Can't by just using the format string for the datetime ruler object; it will put whatever is needed to make the date labels uniq...

más de 8 años hace | 0

| aceptada

Respondida
How do I prevent the legend from REALLY auto-updating
Actually, it's simpler than outlined; that kept extra lines around; don't even need that; just use the builtin feature of plot()...

más de 8 años hace | 1

| aceptada

Respondida
greek symbols in my code
<https://www.mathworks.com/matlabcentral/answers/334191-how-can-i-use-a-symbol-as-a-variable?s_tid=answers_rc1-3_p3_MLT#answer_2...

más de 8 años hace | 0

| aceptada

Respondida
How to get amplitude of the signal from FFT results?
Had a fairly protracted discussion on subject recently here <https://www.mathworks.com/matlabcentral/answers/395585-normalize-ff...

más de 8 años hace | 1

Respondida
How to add error bars on bar graph with groups?
See <https://www.mathworks.com/matlabcentral/answers/379570-how-can-i-place-my-error-bar-in-separate-bar-center#answer_302325 <E...

más de 8 años hace | 5

Respondida
Why is det a bad way to check matrix singularity?
You can start with <https://www.mathworks.com/help/matlab/ref/det.html#bubi9tw <Limitations of det>> for bare bones; I don't hav...

más de 8 años hace | 2

Respondida
how do i make a function repeat 10 times.
Guillaume addressed how to loop, I'll note that the double loop above can be written succinctly as W=filter2(ones(3)/9,p,'v...

más de 8 años hace | 0

| aceptada

Respondida
How to shift the entire columns in raw file to the left and hence deleting all the empty columns in the sheet in matlab?
t=readtable(filename,'Sheet','Markings'); % tables are much more simpler than raw cell arrays ix=~all(ismissing(t)); ...

más de 8 años hace | 0

Respondida
For loop within a function f
f=@(x)((0.0011*(x(2+i*N:j*N)-x(2-1+i*N:j*N-1)))' *exp(-0.0078*x(Battery_num*N+1+i*(N-1):Battery_num*N+j*(N-1))))*Battery_cost/...

más de 8 años hace | 0

Respondida
How would I go about finding the standard normal probability based on the z-score?
doc normcdf doc normpdf When you know what you want but not sure the name, try something like >> lookfor normal re...

más de 8 años hace | 1

| aceptada

Respondida
What is the precision of *.datenum, which dir() returns
|datenum| is a double; hence has 15-16 significant digits; the safest way to store it is as a double but you'll get as close as ...

más de 8 años hace | 1

Respondida
Biggest Error in Spline Interpolation
OK, good start and marks for posting work! :) You didn't define _x_ above; I presume you somewhere else did something like ...

más de 8 años hace | 1

Respondida
Only keeping minimum values in a matrix and setting them to 1
[~,ic]=min(D,[],2); % find location min each row D=zeros(size(D)); % ...

más de 8 años hace | 0

Respondida
How can I add a plot over a boxplot (same axis)?
Works ok here to plot() data on top of a boxplot; didn't use grouping variables though so the x-axes values are 1:N where N is t...

más de 8 años hace | 2

| aceptada

Respondida
How to use a loop with datetime and store the datetime values?
dtday=[t1:datetime(2012,4,18+1)].'; % array of fixed start times each day dtm=[]; for i=1:length(dtday) d...

más de 8 años hace | 0

Respondida
How can I write into an excel file column wise?
for col=1,N V=yourColumnOutputFunction(... xlswrite(file,sheet,[xlsAddr(1,col) ':' xlsAddr(size(V,1),col)]); end ...

más de 8 años hace | 1

| aceptada

Respondida
[DISCONTINUED] MATLAB Answers Wish-list #4 (and bug reports)
Seems excessively strict given that the "extra-x" format is now default for all MS Office products; what's the reason isn't allo...

más de 8 años hace | 3

Respondida
fprintf cell array if its size changes
Sure...just build dynamic format string... >> fmt=['function dX = myFunction(' repmat('%s,',1,length(myCellArray)-1) '%s)\n...

más de 8 años hace | 0

| aceptada

Respondida
What is the difference between .' and ' when transposing a matrix?
doc punct % Concise description of all Matlab punctuation-symbols syntax doc transpose doc ctranspose for the two ...

más de 8 años hace | 1

Respondida
File data with columns arranged with different number of rows.
With the assumption of just three specific arrays, the last idea-- a=length(A);b=length(B);c=length(C); % len...

más de 8 años hace | 1

| aceptada

Cargar más