Beantwortet
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

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
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)...

etwa 11 Jahre vor | 0

Beantwortet
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 ...

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

etwa 11 Jahre vor | 1

Beantwortet
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...

mehr als 11 Jahre vor | 1

Beantwortet
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 ...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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. ...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 0

Frage


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:...

mehr als 11 Jahre vor | 3 Antworten | 2

3

Antworten

Frage


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...

mehr als 11 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


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...

mehr als 11 Jahre vor | 0 Antworten | 0

0

Antworten

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 2

Beantwortet
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...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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','...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 2

| akzeptiert

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

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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( ...

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
I know this is a rookie question but its been years since I've used MatLab. I need to use p_r,p_p,p_s to calculate p_rn,p_pn,p_sn and then use those values in place of p_r,p_p,p_s in subsequent calculations and then store them all in a matrix.
_*The comment caused me to deleted my first answer.*_ *Caveat: I know next to nothing about Game Theory* *Assumption:* The...

mehr als 11 Jahre vor | 0

Beantwortet
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="([^...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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,...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

Mehr laden