Community Profile

# dpb

Last seen: Today 2012 以来アクティブ

All

バッジを表示

#### Content Feed

Extract values from a data table and create a new table
What did you try? Have you looked at the "Getting Started" section on array indexing/addressing; specifically logical indexing?...

Using Contourf to Create Contour Plot with XYZ Data
You don't have enough data -- to use contourf, you must have size(Z) = x by y points -- you've got >> whos x y z Name ...

| 採用済み

Convert to fixed values and replace N/A with zero?
As @Rik, I have no klew what fixed values are to be, but the other Q? is trivial -- Brute force... data=readtable('micro.txt...

Creating text file by combining/editing header and data
N1=34; % file1 header length -- don't bury magic constants inside code N2=64; ...

Reading 8x8 matrices from file into MATLAB
Try something like fid=fopen('yourfile.txt','r'); i=0; C=[]; while ~feof(fid) i=i+1; C{i}=reshape(cell2mat(textscan(fi...

1日 前 | 0

Read a matrix between elements
I'd go at it something like N=1000; D=3000; for i1=1:D:size(x,1) % starting index each subsection i2=i1+N-1...

1日 前 | 0

How do I split this data into different column and write it back in a text file with an extention .bdf?
data=readlines('mat.fem'); M=split(data(startsWith(data,'MAT1'),:),','); M(:,4)=num2str(rand(size(M,1),1)); modifies MAT1 as ...

1日 前 | 0

Does @(x) matlab function exist in C language ?
Standard C does not include what is generically called a "lambda" outside MATLAB. GCC has an extension but I've never used it. ...

1日 前 | 1

| 採用済み

How do I split this data into different column and write it back in a text file with an extention .bdf?
So, what is this -- the content of some file, an array of text, a cell array... ?? What are we looking at here? If it's a text...

1日 前 | 0

create a matrix of maximums
You didn't say there were values anywhere excepting in one column out of this array before -- you don't need no steenkin' loops ...

1日 前 | 0

List files in current directory based on a pattern in a variable.
weeklyDates = [20101031;20101107;...]; for i=1:numel(weeklyDates) pattern=sprintf('*%d*.nc',weeklyDates(i)); d=dir(patter...

1日 前 | 0

| 採用済み

Find a row of the maximum of a matrix
I fail to see the point in an array of 1960x400 of which 1959 columns are all identically zero??? That aside, what's the issue ...

2日 前 | 0

to build a table with XYZ values
See meshgrid to build the coordinate arrays; you'll have to have the corresponding observation values from somewhere else. Use ...

2日 前 | 0

Large integers saved as csv files are rounded up
WAD. Per the doc csvwrite (NOT recommended, btw), csvwrite writes a maximum of five significant digits.... Use writematrix i...

2日 前 | 1

| 採用済み

Sort twice within the same dataset
Well, it's certainly not totally clear what you mean -- but if you mean sort by multiple columns, see sortrows, the optional sec...

3日 前 | 0

| 採用済み

How to apply moving harmonic average on an array?
Simplest is probably just brute-force -- HM=[Kd_1(1) arrayfun(@(i)harmmean(Kd_1(i:i+1)),1:numel(Kd_1)-1) Kd_1(end)].';

3日 前 | 0

How do I set a parameter based on individual values in an existing array? Should I use a for loop or something else?
The above if...elseif...else...end construct works; there are other ways -- one way w/ MATLAB is fnDL=@(L)interp1([500-eps(500)...

3日 前 | 0

whats wrong with this code?
But 'vektprosent_best_salts' is an array containing two entries per record, not one. Hence matching "70" by itself is bound to ...

3日 前 | 0

when i'm trying to save as excel xls to xlsx format in actxserver it doesnot work
You can't pass an OS command to be executed as the file name; my recollection is also that the .Open command needs a fully-quali...

4日 前 | 0

Why do i keep getting the ereor "The value assigned to variable *** might be unused"
The warning is given because your code never references/uses the frequency vector, f, after defining it -- there's nothing in th...

5日 前 | 1

| 採用済み

Too many input arguments.
So much for help, Steven!!! :) Doncha just love folks who don't document a thing...not. function [lame_eau, CemaParam] = CemaN...

8日 前 | 0

| 採用済み

Use two different color schemes in contour plot
OK, with the explanation that you expect the two contours to not actually overlap, then it's feasible -- here's a sample with an...

8日 前 | 0

How to display datetime value or duration value in Edit Fields (Numeric or String)
Well, yes, do what the error says -- convert the datetime and/or duration to string representation. >> dt=datetime(datestr(now)...

8日 前 | 0

How to pass the index of a loop from one MATLAB App to another in real time
One way is through a memory mapped file <Share-memory-between-applications> Alternatively, although I've no familiarity with th...

9日 前 | 0

How do I turn string "C = A*B" to "data.C = data.A.*data.B " while the equation and variables may change?
If the table name is fixed, then it's easy -- use dynamic field names as explained in accessing data in tables -- and specifical...

9日 前 | 0

Display values barh, YEndPoints/XEndPoints does not work
One of the previous postings -- same idea but uses the internal Offset values from the bar handles... <How-do-i-label-each-bar-...

9日 前 | 0

Plots and legend don't match
Besides Walter's note that you're using ii in the second plot instead of jj,it would be cleaner/simpler to do something like fo...

9日 前 | 0

| 採用済み

How to repeat value in Cell using MATLAB
fnRM=@(v,c)repmat(v,1,c); for i=1:numel(Value) C{i}=cell2mat(arrayfun(fnRM,Value{i},Counts{i},'UniformOutput',false).'); en...

10日 前 | 0

| 採用済み

Need a fix for interp1 error
The simplest is to use [ux,ia]=unique(x); vi=interp1(ux,y(ia),v); This will use the first of the y values for each unique x...

10日 前 | 0

| 採用済み

issue with matlab function
It's not MATLAB's fault, it did exactly what you told it to do...just your instructions weren't what you intended! :) While we...

10日 前 | 0