Community Profile

photo

dpb


3,878 total contributions since 2012

Contact

dpb's Badges

  • Thankful Level 2
  • 36 Month Streak
  • Ace
  • Revival Level 1
  • Knowledgeable Level 4
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
Can I reorder the legend entries for gscatter
Yeah, just redo the legend manually with the handles in the desired ordered... ... hGS=gscatter(TA_est,TA_meas,strtrim(height)...

1 day ago | 0

Answered
Setting a logical matrix to a number
A logical array is either 0 or 1...if you put something else in an element, then the array can no longer be class logical You c...

1 day ago | 0

| accepted

Answered
Converting Binary files to ASCII
OK, that's all you should need... fid=fopen('yourfile.ext','r'); data=fread(fid,[inf,4],'single'); fid=fclose(fid); should r...

1 day ago | 0

Answered
Finding the value of chi-squared for a linear fit
mdl=fitlm(xi,yi,'intercept',false);

1 day ago | 0

Answered
how to get back numerical value
F1_char = num2str(F_double); fprintf(fid, '%s', F1_char); You wrote the string representation of the values of F_double sequen...

1 day ago | 0

Answered
Plot a drawn, filled shape at each data point
S=1; % Side size X=50; Y=10; % location hR=rectangle('Pos...

1 day ago | 0

Answered
For loop in linear regression for number of assets
X = Indreturn; %(historical data of market index returns) Y=EFreturn(:,:); ...

2 days ago | 0

Answered
How to plot multiple horizontal bar plots in single figure?
You'll have to do that by having two axes so that you can have two separate barh objects...I've railed at TMW for 20 years about...

3 days ago | 0

| accepted

Answered
How to get x-axis to be in seconds utilizing the timetick or comparable function
tfmt='dd-MMM-yyyy HH:mm:ss:SSS'; start = datetime('08-Feb-2019 07:32:50:503','InputFormat',tfmt); stop = datetime('08-Feb-2019...

3 days ago | 0

Answered
Function output into a variable
[r th]=AddVecPol(5,23,12,40); ML only returns results if you provide somewhere for it to throw them...otherwise the first of mu...

3 days ago | 0

Answered
writing output in excel file with variable to decide starting cell to write data
Sure, just use my little utility xlsAddr to build the address and pass to xlswrite for i=1:N output=yourfunction(data(:,i)...

3 days ago | 1

| accepted

Answered
Polynomial equation not giving expected result
Just because the coefficient is small doesn't mean it isn't important...it is, after all the coefficient of x^5 and 75^5 = 2.373...

4 days ago | 0

| accepted

Answered
Labeling Axises, YTick spacing, maximum and minimum labeling
>> [mx,i]=max(zc(:)) mx = 154.5315 i = 10403 >> [imx,jmx]=ind2sub(size(zc),i) imx = 101 jmx = 103 >> zc...

4 days ago | 0

Answered
Help with labelling the axes of a plot.
Something like hL=plot(reshape(t,12,[]),reshape(y,12,[])); is really easy to get the effect by ML's treating each column on ...

4 days ago | 0

| accepted

Answered
How do I avoid scientific notation when using fprintf to print numbers into a text document?
If you want/need a specific format, say so... :) When you use '%d' for a floating point value, since it expects an integer valu...

5 days ago | 0

Answered
How can I move the Xlabel without moving the X-Axis?
You've got to override the default position data for the label when move the axis location to center-- Ylm=ylim; ...

5 days ago | 0

Answered
Determine if an array has any elements that are zero ?
function flg = isFullPoly(b) % isFullPoly(b) returns T if all coefficients, b, nonzero, F otherwise flg=all(b); end Thi...

6 days ago | 0

| accepted

Answered
How do I sort an array by only one column?
doc sortrows % ALWAYS read "See Also" when looking for related functions!!! >> help sort sort Sort in ascending or des...

6 days ago | 1

| accepted

Answered
How to analyze the relationship between my data in a survey
"Carefully!" :) So happens had reasons to think about this some recently -- a couple links I found of some use: https://www3....

7 days ago | 0

| accepted

Answered
read certain range in csv file and save to new file
Same basic solution but one can write the loop without an explicit loop -- of course, it could easily be found to be less effici...

7 days ago | 0

Answered
How to position added text in the graph at the upper right corner of the graph?
xL=xlim; yL=ylim; text(str,0.99*xL(2),0.99*yL(2),'HorizontalAlignment','right','VerticalAlignment','top')

7 days ago | 0

Answered
ERROR unable to convert 'string' value to 'int64'
Name Size Bytes Class Attributes HighTemp 4x1 16 int32 LowT...

7 days ago | 0

Answered
Tables: Transform Variablenames
...,'ReadVariableNames',0); % use the named parameters as needed See doc readtable Also, in general, doc detectImp...

8 days ago | 1

Answered
Smoothing multiple files and save it into new file
See FAQ https://matlab.fandom.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F I'm particularly fond of the dir() solution...

8 days ago | 0

Answered
ERROR unable to convert 'string' value to 'int64'
Yr = 1900 + Yr; fileNew = fopen(newFileName,'w'); Mnth = string(Mnth); T = [Yr Mnth LowTemp HighTemp Precip]; You've got a n...

8 days ago | 0

Answered
I'm wanting to change my formatting to scientific and output values in a table
Your table isn't what you think it is...study the output carefully and the orientation of the data in the table... HINT: You n...

8 days ago | 0

| accepted

Answered
how to perform xor of two bits in matab
See doc bitxor to do the logical operation on the content of the variable in its internal storage pattern; you can convert the...

8 days ago | 1

Answered
convert two columns( one real number and the other is imaginary but without (i) symbol) in txt file to complex number and one column.
Use xlsread or what other import functions you care to use to read the data depending on how much of the header info you need, t...

9 days ago | 0

Answered
How to use an an if statement which has two criteria to be met to create a new table
>> W=[1 2 1 2 1 3 2 0 0 2].'; >> F=[0 0 2 2 0 0 3 3 0 0].'; >> ix=(W<2) | (W>1 & F>0); >> [W(ix) F(ix)] ans = 1 0 ...

9 days ago | 1

| accepted

Answered
Read multiple csv and plot
formatSpec = '%s%s%s%s%s%s%s%s%s%s%s'; csv_dir = uigetdir(' '); d=dir(fullfile(csv_dir, '*.csv')); for i=1:numel(file_list) ...

9 days ago | 0

| accepted

Load more