Community Profile

photo

dpb


4.273 total contributions since 2012

Contact

dpb's Badges

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

View details...

Contributions in
View by

Answered
how can i print an array using fprintf function?
You didn't put but one numeric formatting string in the format; hence, the whole thing repeats as often as needed to output the ...

etwa 18 Stunden ago | 1

| accepted

Answered
Get data from a Cellstr
On the presumption there's a much larger lookup table in the real application... X=[17,21]; % lo...

ein Tag ago | 0

Answered
Assign a part of file name to a variable
m=str2num(char(extractBetween(myfolderinfo(i).name,'_','.')));

3 Tage ago | 0

| accepted

Answered
Warning: The assignment added rows to the table, but did not assign values to all of the table's existing variables. Those variables will extended with rows containing default values.
Apparently you had a table with N variables but only assigned values to a subset of those when adding rows. Example: >> x=rand...

3 Tage ago | 0

| accepted

Answered
Timestamps on X axis from datetime
You've got to create datenum array to match to plot against for datetick to work correctly. Or you need to plot the x axes usin...

3 Tage ago | 0

Answered
HOW TO COMBINE TWO CELLS INTO ONE?
As Adam notes, you have two arrays as shown (I took the liberty to reformat the original Q? to make more legible) and there's a ...

5 Tage ago | 0

Answered
How to plot a graphic with different markers in a scatter plot?
"plot each "9 dots" in the graphic with "different marker.". Not each group." Wow. But, ok...that's simpler with plot than it ...

6 Tage ago | 0

Answered
How to create pseudo x-axis (or y-axis) tick labels?
With the background as to "why", basic idea would be something like Ratio=100/3; % the divisor for modifying the actual ...

7 Tage ago | 0

| accepted

Answered
Why is the or statement making something true?
"Am I doing something wrong with the | as or?" Yes you are...the above is the same as if Overall_max_score==(scores(1,3)|score...

8 Tage ago | 0

Answered
change datatype of x axes
Axes are not polymorphic--they require a given data type. You'll have to create two axes and select which to display depending ...

8 Tage ago | 1

| accepted

Answered
Function with structure field syntax
"You can also call a method using dot notation....It is not necessary to pass the object explicitly as an argument when using d...

8 Tage ago | 0

| accepted

Answered
Insert zero in an array when a certain value is exceeded
U=T; U(SETT>175)=0;

9 Tage ago | 0

Answered
How to extract text from string at the same location, one line above
Presuming have read the file into a string array, s, >> isOK=contains(s(find(contains(s,"12345"))-1),"999") isOK = logical...

9 Tage ago | 0

Answered
how to set NaN values red in a figure ?
I guess you could interpolate to fill in the NaN locations and then scatter3 them on top of the surf w/ the red marker...otherwi...

9 Tage ago | 0

Answered
Plotting data as a function of time
For the given description, yes. BUT, you should probably create your date vector as one of the datetime or duration class inste...

10 Tage ago | 1

| accepted

Answered
Simple linear regression, prediction intervals behave strangely using predint
It's the use of the ''observation','on' for the simultaneous bounds that's causing the much wider prediction interval bounds. N...

13 Tage ago | 0

Answered
How to find the mean peaks in positive axis
thresh=0; % or whatever level you wish pks = findpeaks(y,'MinPeakHeight',thresh); Read the doc carefully; findpeaks has all...

16 Tage ago | 0

| accepted

Answered
Combining multiple plot statements.
As is, the above code snippet leaves only the result of plot((1-sqrt(5)),0,'g^', 'MarkerFaceColor', 'g') on the figure because...

16 Tage ago | 0

Answered
MinPeakDistance ignoring some peaks it shouldn't
See <Answers 482540: Logic of findpeaks> for what's behind the cause for this. You'll have to modify your search pattern to loo...

18 Tage ago | 0

| accepted

Answered
probem with FaceColor of bar
Carrying on from the above after defining data... clrs=[[1 0 0];[0 1 0];[1 1 1];[0 1 1];[0 0 1];[1 1 0];[0 0 0];[1 0 1]]; % rgb...

23 Tage ago | 1

Answered
Plotting multipe lines with different width
Firstly, your time problem is that your A and B are the vectors of all points and you're plotting the whole thing every time by ...

24 Tage ago | 0

| accepted

Answered
HOW TO CONVERT AN .OUT FILE TO .TXT FILE VIA MATLAB
There's nothing about the file content that is specific to the name including the extension. fn='yourfile.out'; [~,f]=filepar...

24 Tage ago | 0

| accepted

Answered
Using a for loop to iterate over rows of a matrix?
Alternatively, consider vectorizing the function instead of using a loop... function [Re, flow_type] = Reynolds(p,v,L,u) ...

25 Tage ago | 0

Answered
How would I 'trim-the-fat' off of individual text files that are part of a loop?
" I'm going to have multiple files with arbitrary names, that need to be analyzed and concat[e]nated " Presuming this is relate...

25 Tage ago | 0

| accepted

Answered
Using the find function in a for-loop: Need to solve an error - "Unable to perform assignment because the left and right sides have a different number of elements"
find will return a variable number of outputs depending upon the inputs and you've written the code with the presumption of only...

25 Tage ago | 0

| accepted

Answered
Logic of find peaks function
As Adam says, the doc does explain... "When you specify a value for 'MinPeakDistance', the algorithm chooses the tallest peak i...

26 Tage ago | 0

Answered
Selecting data from an imported table
Presuming the data array is variable array x and it's the first column to explore... x=xlsread('yourfile.xls'); ix=find(diff(x...

26 Tage ago | 0

Answered
How to append new data to a box and whisker plot
d=dir('*_01.mat'); v=[]; for i=1:length(d) V=[v load(d(i).name)]; end V=cell2mat(V); boxplot(V) from what you've told u...

26 Tage ago | 0

Answered
What exactly is going on with this code? I'm having difficulty understanding it
"If you set the directory to the three fiels linked, you'll process them in about 30 seconds." I did set breakpoint in debugger...

29 Tage ago | 0

Answered
Mark max value and min value with red circle
[~,imx]=max(y); [~,imn]=min(y); hold on plot(x([imn;imx]),y([imn;imx]),'or') or as I was going to do originally as noted in ...

30 Tage ago | 0

| accepted

Load more