Risposto
How to write this for loop into while loop?
Something like this might do it k = 1; while k <= 9 x = k^2 k = k+3; end

circa 11 anni fa | 0

| accettato

Risposto
Find multiple true in same row
Hint: >> A=[1 0 0; 1 0 1] A = 1 0 0 1 0 1 >> B = A==1 B = 1 0 ...

circa 11 anni fa | 0

| accettato

Risposto
if statements, setting large numbers
The matlabish way: >> test = @(a,b) ( a>5 & b<5 ); >> test( [1;6],[6;1] ) ans = 0 1 >> test(6,6)...

circa 11 anni fa | 0

Risposto
how to use datestr?
With R2013a this is the way >> vec = datevec( now ) vec = 1.0e+03 * 2.0150 0.0050 0.0230 0.0070 ...

circa 11 anni fa | 1

| accettato

Risposto
Use of Persistent Variables in Class Methods Producing Incorrect Result.
I reproduced the behavior with R2013a and it's not what I would have expected. However, whether it's _"incorrect results"_ depen...

circa 11 anni fa | 1

Risposto
How to use memoization in MatLab?
See <http://blogs.mathworks.com/loren/?p=19?s_tid=srchtitle Use nested functions to memoize costly functions>, search <http://ww...

circa 11 anni fa | 1

Risposto
How to use memmapfile for a very large structured binary file
This gave me a chance to try a complicated format. Result: filespec = 'usgsdems.dat'; % A sample file I found in the Map ...

circa 11 anni fa | 2

| accettato

Risposto
divide a large text file into two text files
Alternatives * The free (as in beer) program <http://www.gdgsoft.com/gsplit/index.aspx GSplit> splits the file. I was able t...

circa 11 anni fa | 1

| accettato

Risposto
how to convert a column of cells into string?
NaN is double >> class( nan ) ans = double replace Nan by *|''|* (empty string) >> alldata = {'abc', nan, '...

circa 11 anni fa | 1

| accettato

Risposto
how i can take part of email address
... and with *|regexp|* >> regexp( 'baashe@hotmail.com', '(?<=@).+$', 'match' ) ans = 'hotmail.com'

circa 11 anni fa | 1

| accettato

Risposto
Read one column of unknown length from CSV file
I failed. Since *|csvread|* is based on *|textscan|*, I propose you use *|textscan|*. It's at least better documented - IMO. ...

circa 11 anni fa | 1

| accettato

Risposto
Comparing vectors and determining unique values?
Try this script %% cac = { [1 0 3 4] [0 2 3 0] [0 2 0 4] [0 2 3 4] }; % ixa = ( 1 : numel(cac) ); % lin...

circa 11 anni fa | 0

Domanda


NetCDF or HDF5 or XYZ to provide time series data at the fingertips of the user
. *Question:* Have I done my homework well enough to choose HDF5 and stop thinking about alternatives? *One more question:...

circa 11 anni fa | 3 risposte | 2

3

risposte

Domanda


Does the TODO/FIXME Report work with m-files in a package?
*This issue is resolved in R2013b* --------------------------------- Is the TODO/FIXME Report supposed to work without lim...

circa 11 anni fa | 1 risposta | 0

1

risposta

Domanda


Fastest way to search for a short vector in a huge array?
*Background* I have a 16GB text file, which is some kind of dump of a datacube. Each "observation" represents a measured valu...

circa 11 anni fa | 0 risposte | 0

0

risposte

Risposto
how to find the largest power of 2 that a number is divisible?
Hint: >> factor(12) ans = 2 2 3

circa 11 anni fa | 0

| accettato

Risposto
Question about the '@' symbol.
See <http://se.mathworks.com/help/matlab/matlab_prog/anonymous-functions.html Anonymous Functions>

circa 11 anni fa | 2

Risposto
Reading some part of a file
Replace formatspec = '%8c %6c %6c %d %64c %10c %d %d %s %s %s'; by formatspec = '%*8c %*6c %*6c %*d %*64c %*10...

circa 11 anni fa | 0

| accettato

Risposto
How to identify a string and copy the value from the text file
This script str = fileread( 'cssm.txt' ); cac = regexp( str, '(?<=LMD\[q=1,d=2\][ ]+)[\d\.]++(?=[ ]+\%)', 'match','...

circa 11 anni fa | 0

| accettato

Risposto
how to access cell array data with single for loop
C = cell( size(A)); D = cell( size(B)); for ii=1:length(A) C(ii) = A(ii); D(ii) = B(ii); end &nbsp *Add...

circa 11 anni fa | 2

| accettato

Risposto
change the value in a matrix
Try >> B = A; >> B(abs(A)<=3) = 0 B = 0 4 0 0 5 -7 0 0 9 ...

circa 11 anni fa | 0

| accettato

Risposto
How do I get the least used character in the text file ?
Here is a code based on *|histc|* %% ffs = 'GreatExpectations.txt'; fid = fopen( ffs ); buf = fscanf( ...

circa 11 anni fa | 1

Risposto
Read one specific file name
Replace d=dir('TRMM_*_newntcl.csv'); by d=dir('TRMM_*01_newntcl.csv');

circa 11 anni fa | 0

Risposto
textread facing unexpected characters. Gives an error.
Try >> cac = cssm cac = {6x1 cell} [6x1 double] {6x1 cell} [6x1 int32] [6x1 int32] wher...

circa 11 anni fa | 1

| accettato

Risposto
How can I create a structure from a cell array of strings and give it the initial value of zero?
Your goal is that to create a nested structure with hundreds of fields? %% x = cellfun(@zeros, a(:,3),a(:,2),'uni',f...

circa 11 anni fa | 0

Risposto
How do I access the complex text in an xml file?
A quick and dirty variant: str = fileread( 'cssm.txt' ) cac = regexp( str, '(?<=<Nextline name=")([^"]+)" value="([^...

circa 11 anni fa | 0

| accettato

Risposto
Storing varying sized arrays in a single matrix
That isn't possible. However, you may _"store multiple different sized arrays"_ in a cell array cac = {[0 , 1],[0 , 0.5,...

circa 11 anni fa | 1

| accettato

Risposto
Best way to parse text file
NOAA's National Climatic Data Center (NCDC) (and others) publish important data in text files, which cannot be easily read with ...

circa 11 anni fa | 1

| accettato

Risposto
struct problem when dealing with different field types
_"implement a cell in a struct"_ &nbsp I'm not sure I understand. Hint: >> sas = struct('vec',[1:12],'string','abcdefg...

circa 11 anni fa | 1

| accettato

Carica altro