Community Profile

# dpb

4.201 total contributions since 2012

View details...

Contributions in
View by

matlab table from for loops
A table may not be the best for this purpose but iiuc what you're asking for would be something like Nrows=100; Num_of_Banks=r...

1 día ago | 0

Problem with plotting dates
Use readtable and maybe detectImportOptions first. Then, plot is datetime-aware, so you just call plot with the two variables.....

1 día ago | 0

Geoscatter point size in km
I don't have the mapping TB so can't experiment, but looks like <geobubble> would be better suited to the purpose as it does hav...

1 día ago | 0

Can I pass complex numbers from C++ to Matlab using feval or similar?
See mxCreateNumericMatrix for C interface. It can create a complex array. I suppose there's also a C++ version but "I know nut...

1 día ago | 0

Loop for mutliple (but variable) number of plots on multiple pages
Figure out how many figures you need a priori... nplots = 13; pperfigure=12; nfigures=ceil(nplots/pperfigure); nUp=pperfigur...

4 días ago | 0

| accepted

Finding the sum of every nth row ( n is not fixed)
You'll have to introduce a day variable...by locating the positions where the hour returns to 0 if is always a 0-hour reading o...

4 días ago | 0

| accepted

I have multiple equations that depend on a specific value and would like matlab to ask the user which equation to use and what the specific value is and then print that value but it's giving me trouble.
Do something more like: materials={'BK7','Fused Silica','Soda Lime','Borofloat','Air','NOA61'}; [material,ok] = listdlg('Promp...

4 días ago | 0

How to neatly alternate between two different statements at different intervals
counter=0; Limit=10; for i=1:100 counter=counter+1; if counter<=Limit disp('A') else disp('B') counter...

5 días ago | 0

| accepted

Help parsing predictably messy data
function getdata=a1(fname) % read file sections, return as cell array of sections for subsequent use fid=fopen(fname,'r'); ...

6 días ago | 0

| accepted

Sorting Table Data by Groups of Rows
If the number of missing values is always 9, then extract the time column to a vector and t=datatable(:,1); % retrieve th...

6 días ago | 0

Finding first rightmost non-zero column of a matrix?
Same solution as the other except search from the other end... find(any(A),1,'last') I think Azzi's solution there doesn't fin...

6 días ago | 0

| accepted

Extract columns from multiple csv files
targetColumn=3; % don't bury magic numbers, use input() to set, maybe... rootdir = 'C:\Work\TESTIN...

6 días ago | 0

To generate alternate 0's and 1's
One brute force way-- B=[]; for i=1:numel(A) B=[B (1-mod(i,2))*ones(1,A(i))]; end

6 días ago | 1

How to solve "Matrix dimensions must agree" getting from Matlab.
OK...still a little unclear but I think I've got enough of a picture to at least lay out the general idea. It'd be a lot easier...

6 días ago | 0

Data Linking And value reassignment for variables
I presume the "~-0" clause is to not eliminate i==j? Or can there be actual identical matches elsewhere? Either way the first...

7 días ago | 0

| accepted

Troubleshooting Import big excel file
>> t=readtable('export.csv'); >> whos t Name Size Bytes Class Attributes t 45x255 ...

7 días ago | 1

| accepted

How to solve "Matrix dimensions must agree" getting from Matlab.
if ('difficult = 0-back') & ('sleepstate = SD') is bad syntax on many fronts. First you've built a quoted string by usin...

7 días ago | 0

Help concatenating a table row to a specific excel spreadsheet?
outputTable=table(VarNameStr,Screen_Grasp_Average,Grasp_Release_Average,difference); writetable(outputTable,D:\LocationName\Dat...

8 días ago | 0

| accepted

FFT - How is the signal distributed between different frequency bins?
The frequency bins are fixed by the sampling rate; the magnitude of each bin is determined by the computation of the fourier coe...

8 días ago | 1

| accepted

Plot function into subplots
for i=1:3 hAx(i)=subplot(3,1,i); plot(x(:,i),y(:,i)); end presuming all x,y are same length. If they're not, then savin...

8 días ago | 0

| accepted

Colormap utility - two axes in colorbar
Yeah, it's doable...refinements needed, but general idea works. Z = peaks(20); [~,hCF]=contourf(Z,10); hAx=gca; ...

8 días ago | 1

| accepted

Set Properties.VariableContinuity to a single column in a timetable?
Per the documentation, ". This property can be an empty array, which is the default. If the array is not empty, then the number ...

9 días ago | 0

| accepted

Ah! That's actually a link to an Excel spreadsheet file, not web service data. Use websave('UMichSurvey.xls',url) ...

9 días ago | 0

| accepted

functions suddenly connected after restart
Apparently focus was in the editor and some of your keystrokes CTRL^C got interpreted to paste and some extra end statements wer...

9 días ago | 0

How to set mmmm dd, yyyy as per our choice in the datestr command?
datestr(datetime(2017,9,2,2,0,0))

9 días ago | 0

Avoiding automatic sorting of eigenvalues
EIG() does NOT return sorted values; it returns them to the user in the order in which the underlying LAPACK routine calculates ...

10 días ago | 1

How to display a vector in edit text in MATLAB?
By default it appears the Edit control converts an array to a column array of values and you can't display that in one row...if ...

10 días ago | 0

remove first element in cell and do not change index of other element
You're overthinking the problem...the first index is always 1... >> cellfun(@(a) 2:numel(a),A,'uni',0) ans = 1×3 cell array...

10 días ago | 0

| accepted

a big cell array
Follow the documentation--for xlswrite, every cell element has to be a single value. So, if your array has cells (or any single...

11 días ago | 0