Question


When was 'tokenize' dropped from regexprep?
With R2016a I get this warning >> regexprep( 'abc123def', '(\d{3})', '.$1.', 'tokenize' ) Warning: The 'tokenize' op...

plus de 8 ans il y a | 1 réponse | 1

1

réponse

Réponse apportée
Find cell containing part of a string
>> find( ismember( colorList, strsplit( stringToCheck ) ) ) ans = 3 or >> find( ismember( colorList, s...

plus de 8 ans il y a | 2

Réponse apportée
How to store values as array
There are a couple of mistakes in your code. Try this k = nan( 1, nn ); % pre-alloctate memory for ii = 1 : nn ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
changing minutes after midnight into a datetime array
_"but I only need the MI"_   I don't think you can avoid the date and time. X = 60*[1,2,3,4,5,6,7]; T = datetime( X...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
How to obtain a set of matrix from another matrix by adding the previous row value along the column to the next row on the same column
Is this what you want? >> cumsum( a, 1 ) ans = 2 4 5 8 7 9

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Create an array of strings
>> fruit = {'apple', 'cherry'} fruit = 'apple' 'cherry' with curly braces creates a cell array of strings. I ...

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
Can't create hdf5 file using batch scripts.
The function, *|strcat|*, has no effect in the statement file_name = strcat('/home/usr/test_results1'); which is equival...

plus de 8 ans il y a | 0

Réponse apportée
Testing private functions in classes
First goggle "test private method" and read about why you should *not do it* (and a few ways to do it). One way (for handle ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
finding string in between
*|yourNumber|* is overwritten in the loop and only the last value is saved. The first step to fix your code is yourNumber ...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
The RHS is a scalar K>> A( l, m, kindex, j, n+1 ) ans = 0 K>> the LHS is a 3x3 matrix K>> whos z ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
what is the word need to fill in this blank
>> x = 1:4; >> y = 2*x.^2 y = 2 8 18 32 But wouldn't it had been better to find this in the do...

plus de 8 ans il y a | 0

Question


Wanted: Examples on how to use "Dynamic Regular Expressions" to debug regular expressions
I try to develop a function, *|is_string_constant|*, which takes a text string of Matlab code and returns a logical vector, whic...

plus de 8 ans il y a | 2 réponses | 1

2

réponses

Réponse apportée
How to access second axes in the PLOTYY syntax?
plotyy returns a vector of two axis-handles. (The diagram (before HG2 and I guess in HG2) was two plots on top of each other.) ...

plus de 8 ans il y a | 0

Réponse apportée
Any approach faster to concatenate multi dimension cell?
Try >> S = load('completedata.mat'); >> S.data_lap_th ans = [1x1 struct] [1x1 struct] [1x1 struct] [...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
searching a string for a word
Try >> regexpi( 'And, and other words and_ 2and and', '(^|\W)and(\W|$)', 'start' ) ans = 1 5 31 The se...

plus de 8 ans il y a | 1

Réponse apportée
Function for day of the year
Introduced in R2014b >> day( datetime('07-Jan-2017', 'InputFormat', 'dd-MMM-yyyy' ), 'dayofyear' ) ans = 7 _"...

plus de 8 ans il y a | 3

| A accepté

Réponse apportée
How to modify vectors in a for loop?
Replace for i=[1,23] by for i=1:23 and look up <https://uk.mathworks.com/help/matlab/ref/for.html *|for|*> in th...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How to convert decimal to time?
*|datestr|* takes days as input. Thus, divide by 24. >> val = 7.6; >> datestr( val/24, 'HH:MM' ) ans = 07:36 I ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
putting several matrices as one
The matrices must have the same number of rows and have values of the same class. len = 7; A1 = ones( len, 2 ); A2 ...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
I need help fixing one problem with this functtion.
Try to put if numRemoved == 0 num = 0; newstr = str; end at the end of your function

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Cell array filtering date and time using datenum
Replace *|X{:}|* by *|char(X)|* >> X = {'30/12/2015 15:54:30';'30/12/2015 15:54:30';'30/12/2015 15:54:30'}; >> num...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
I have extracted 'time' from excel sheet but got in different format.
You are right, it's confusing and it's because Excel stores its serial date number internally and shows it on a format chosen by...

plus de 8 ans il y a | 1

Réponse apportée
Create a multidimensional matrix from very large set data?
My steps * Put your code inside a loop * Converted to function, because I like functions better. Easier to debug. Doesn't li...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How to remove a dimension from multiple arrays and store it in different cell arrays or consecutive distinct arrays
The major problem with your code is that &nbsp; *|Mod.Var3D.P.AllNivel.Dia{p}|* &nbsp; is overwritten for every new value of the...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Read multiple txt files and remove 2nd line with all dashes and output back to files to append _output in the filenames
I run your code successfully after having replaced fidOut=fopen(SBFsample(i).name,'output.txt','w'); by fidOut=...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Decimal number between 0 and 1 without the integer part?
This code strips off leading zeros; replaces leading zeros with an empty string. >> str = regexprep( num2str( 0.25, 2 ), ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
uigetfile and large dialogue box
The dialogue box "remembers" its size (and position) from when it was last closed. Try this: # open the dialogue # right ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How can I produce Matlab Figure with lower memory size?
I made a little test >> plot( randn(1,100) ) >> savefig(gcf,'c:\tmp\savefig') >> print( 'c:\tmp\dsvg', '-dsvg' ) >...

plus de 8 ans il y a | 1

Réponse apportée
Too many output arguments problem
Replace function myrand a = 1+rand(3,4)*9 end by function a = myrand a = 1+rand(3,4)*9; end ...

plus de 8 ans il y a | 1

Réponse apportée
Is it possible to temporarily disable the private attribute of object properties in debug mode in MATLAB 7.9 (R2009b)?
The answer by the Team does not include the current values of the private properties. I modified their class to display the curr...

plus de 8 ans il y a | 2

Charger plus