回答済み
I have a CSV file with date and time values I want to import and convert to datetime
Use t = datetime(DateStrings,'InputFormat','M/d/y h:mm:ss a'); instead. 'MM' --> Months and 'SS' --> fractional seconds ...

10年以上 前 | 0

| 採用済み

回答済み
Plotting 2 data points with error bars in different colors
Can't set them indendently with one *errorbar* handle as they're one line object for the points and another composite group for ...

10年以上 前 | 0

回答済み
how do I control Axis Location from bottom and left to become in the middle?
See _[X|Y]AxisLocation_ property at <http://www.mathworks.com/help/matlab/ref/axes-properties.html <axes-properties>>. Specifi...

10年以上 前 | 0

回答済み
Replace a zeros row with one under a condition very important for me
On the first, I know there is a submittal on File Exchange to count runs; I think it _may_ be from Bruno Luong...but, consider w...

10年以上 前 | 0

回答済み
Writing string and numerical values to same line in .txt file
secs=1; % define as variables; hardly worth the effort as fixed strings... modl=200; ... fprintf(fid,'%10s=%5d\n'...

10年以上 前 | 0

| 採用済み

回答済み
Hello, I have so problem with this code segment? When I try to run this program, I receive a error warning "Too many input arguments". Help me to fix this problem! Thank in advance!
Too much code; too little information. Give us _only_ the actual error in context cut 'n pasted from the screen and the defin...

10年以上 前 | 0

| 採用済み

回答済み
HELP with for loop plots and changing symbol styles
for ii = 1:N; for k=1:length(col); plot(X(ii,:), col{k}); end end You're plotting the same data over a...

10年以上 前 | 0

| 採用済み

回答済み
Undefined operator '*' for input arguments of type 'struct'.
While not your problem, a stylistic note-- for i = 1:7 y(i)=[x(i+6)]; end should be written in Matlab as y=...

10年以上 前 | 0

回答済み
Define a matrix elementwise
Q=1./abs(A).*(B~=0); % 1/abs(A) and zero B locations Q(isnan(Q))==0; % fixup 0 locations from A (logical*Inf-->Na...

10年以上 前 | 0

| 採用済み

回答済み
sir i have two conditions with if true i have to take response as 1 else 0 and store the values in an array
Assuming you really did mean to have both conditions increment the same counter variable, Matlab doesn't need any loops nor even...

10年以上 前 | 0

回答済み
How to change axes linewidth?
See <http://www.mathworks.com/help/matlab/ref/axes-properties.html <axes-properties>> _'linewidth'_

10年以上 前 | 0

回答済み
How can I scan a text file in order to read a specific number in a line?
Don't try to read from a file each time; read the data into memory and use lookup... >> M=0:0.5:5; >> P=[1,.8,.5,.3,.1,....

10年以上 前 | 0

回答済み
How do I read in a binary file that has a very unique data structure?
There's no facility in *memmapfile* to handle arbitrary bit-lengths; you'll have to map the 12-byte type to an array of 3-x-uint...

10年以上 前 | 0

回答済み
Using output from a nested function in parent function?
_"Functions that return output arguments have variables for the outputs in their workspace. However, parent functions only have...

10年以上 前 | 0

回答済み
Replace certain matrix values with zeroes (more complex than other similar questions)?
Does seem bizzaro, indeed, but presuming there's a need there's a way... >> mm=repmat(m,sum(s),1); >> mm(1:2*size(m,1),1:s...

10年以上 前 | 1

回答済み
how to fix fread error ?
In function *MNISTParser* fp = fopen(filename,'r'); magic_number = fread(fp,1,'uint32',0,'b'); you didn't test the re...

10年以上 前 | 0

| 採用済み

回答済み
RMS error and Mean absolute error from text files
... % Creating 30% of sample as -9999.0 nr=round(n*0.3); TE=Tmp(randperm(n,nr)); good_temp = find(TE); ... I...

10年以上 前 | 1

| 採用済み

回答済み
Preallocating for speed, what kind of variable is this?
_Box_ is just a 2D array of type whatever is nBox.BoundingBox (which would appear to be a floating point type given the *round* ...

10年以上 前 | 1

| 採用済み

回答済み
Error using sub2ind out of range subscript
_Ugleee code to the extreme..._ :( Format your code; don't use run-on continuation lines wildly. One way to build the init...

10年以上 前 | 0

回答済み
Constant number is changing value, why?
... for ind=1:1920 ... xOvito(ind)=xOvito(ind)+magFact*displ(1); yOvito(ind)=yOvito(ind)+magFact*displ(2)...

10年以上 前 | 0

回答済み
How do I make a function that shows the minimum value and index of that original minimum value without the "min()" function?
[minx,idx]=mynotverycleverhomeworkminfunction(x) [s,is]=sort(x); minx=s(1); idx=is(1); More to the point, wh...

10年以上 前 | 1

| 採用済み

回答済み
Can I assign a value from textscan to anything other than a cell array?
The insistence of *textscan* to return only cell array is annoying often, indeed. Only way around what you're doing I'm aware o...

10年以上 前 | 1

| 採用済み

回答済み
How to store vectors with different size in a loop ?
Use cell array instead; the curly brackets... M{k} = found_roots;

10年以上 前 | 4

| 採用済み

回答済み
Generating random ones and zeros controllably
doc randperm % note the second optional input... Will leave as "exercise for the student" the actual application but is st...

10年以上 前 | 0

回答済み
How to select the particular value and store ias a variable?
abs(0.65-0.675) = 0.025 abs(0.75-0.675) = 0.075 so it's not clear how you want 8 as the result instead of 10 as it is th...

10年以上 前 | 0

回答済み
how to find nearest value to zeros?
If the signal crosses zero, look at doc fzero Otherwise, if is all positive the point nearest zero is simply [ymin,...

10年以上 前 | 0

回答済み
How to set YTickLabel in double y-axis plot?
Isn't it annoying that *plot* isn't intelligent-enough to use a consistent numeric format for tick labels??? I've complained ab...

10年以上 前 | 0

| 採用済み

回答済み
Extract two closest rows of a matrix
d=pdist(M(:,2)); % find the pairwise differences ix=find(min(d(1:end-1)); % shortest distance excluding wraparoun...

10年以上 前 | 1

| 採用済み

回答済み
Read a .txt except one column
Looks like an extra count for _'headerlines'_, maybe? 'Pends on whether the above line is the 30th or the previous 30 were some...

10年以上 前 | 0

回答済み
I have a conditional loop that should run when the difference between two numbers n1 and n2 isnot equal to zeros. But sometimes the loop is runs while the difference is equal to zeros. It seems Matlab makes a mistake!! would you help me? Thank you!
Without the actual code and knowing what the variables are it's not certain but a very high probability is that Matlab isn't mak...

10年以上 前 | 0

さらに読み込む