Answered
is there an easy way to import data separated by brackets
Hint: str = '((0,0),(0.1,5),(0.2,7.5))'; M = textscan( str, '%f%f%f%f%f%f' ... , 'Delimiter', ','...

13 years ago | 0

| accepted

Answered
How to input a variation of datenum(now)?
Hint: datestr( floor(now) +7/24, 'yyy-mm-dd HH:HH:SS' ) returns ans = 2012-10-10 07:00:00

13 years ago | 1

| accepted

Solved


Siblings of a graphics object
Given a valid, scalar, handle of a graphical object: find the set of all objects that have the same parent as the original that...

13 years ago

Answered
removing parentheses around digits using regular expressions
>> regexprep( str, '\(([\d.]+)\)', '$1' ) ans = 2+p_5*3-0.3 str = (2)+p_5*(3)-(0.3)+exp(3) >> reg...

13 years ago | 0

Answered
Trying to upload a CSV in matlab
It says: *Use TEXTSCAN* ...., which is a good advise. We cannot help without knowing something about the file.

13 years ago | 0

Answered
MatLab classes using other classes
Yes, instances of other classes may be values of properties. obj.my_property = [ OtherClass, OtherClass ]; creates an...

13 years ago | 1

| accepted

Answered
replacing a string with another and vice versa
A start of one way to use regular expression: string = regexprep( string, '(?<=a)\((\d+)\)', '_$1' ); string = regex...

13 years ago | 1

Answered
Slowing of program when adding legend.
legend is slow, especially if it runs into trouble finding a suitable position. Specify a position and see if that improves the ...

13 years ago | 0

Answered
??? Error using ==> fprintf Invalid file identifier. Use fopen to generate a valid file identifier.
# legal file name? what string is produced by "[pwd '/' directory '/Stats_' vec_info(cd).evmarker]"? # add assert( fid >= 3, .....

13 years ago | 0

Answered
How do I form a loop to perform calculations on series of variables in workspace?
Firstly, have a look at this: <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F...

13 years ago | 0

| accepted

Solved


Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

13 years ago

Solved


Back to basics 26 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of strings of all MATLAB keywords.

13 years ago

Solved


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

13 years ago

Answered
How to give time interval with different parenthesis in matlab?
Try >> t = 0 : 0.0005 : 2-eps(2e3); t(end) ans = 1.9995 >> or >> t = 0 : 0.0005 : 2; t(...

13 years ago | 0

Answered
Am I doing this right?
Here is the output of running a modified version of your script: input height of object:123 h = 123 x =...

13 years ago | 0

| accepted

Answered
"Error displaying value" in Workspace browser for user defined object
Isn't the message Error using disp Too many input arguments. ?? Which Matlab release? *--- Cont. ---* T...

13 years ago | 2

| accepted

Answered
Serial Object with Callback Function Ignores ASCII values > 127
# CRLF, i.e [13,10] is used more often # do you have 8 databits?

13 years ago | 0

Answered
Pass variable by reference to function
No, there is no way to pass a variable by reference. See <http://blogs.mathworks.com/loren/2006/05/10/memory-management-for-func...

13 years ago | 2

Answered
Error to import txt data
Inspection of the file, b_ifi_1.txt, shows # tab-delimited # plenty of "missing data" The error you report is most likel...

13 years ago | 0

Answered
can mlint report undefined variables?
The problem is that w and v could be m-file functions. There is an optional test that you can apply in the File | Preferences | ...

13 years ago | 0

| accepted

Answered
how to combine several functions
Hint: %% f1 = @(k1)108.4*k1; f2 = @(k2)108.4*k2; f3 = @(k3)108.4*k3; %% sumf = @(k1,k2,k3) f1(k1...

13 years ago | 0

| accepted

Answered
Incorrect import of HH:MM data from text file
By definition, the documentations says: In MATLAB, serial date number 1 is January 1, 0000. If date is not given, Matl...

13 years ago | 1

Answered
Unable to export large files from MATLAB to SQL server
*OutOfMemoryError* Did you try increase the allocation of the java heap memory? File, Preferences, Java Heap Memory

13 years ago | 0

| accepted

Answered
What's missing from MATLAB Central...
Yes, there is little *"collaboration on common problems"* at the Matlab Central. To me it appears to be a good idea. Why doesn't...

13 years ago | 1

Answered
How does one input a large amount of data that has a different number of columns per row?
textscan cannot parse rows with variable number of columns. AFAIK: there is no function in Matlab that can do that. There are...

13 years ago | 0

| accepted

Answered
Unidentified function or variable in Matlab cannot figure out
Yes, I cannot see any problem. This code RT = 1e4 * rand( 1, 100 ); jj = 1; for ii = 1:length(RT) if...

13 years ago | 0

Answered
Importing data files with data sets seperated by enters
See the question <http://www.mathworks.se/matlabcentral/answers/47477-parsing-formatted-text-file-quickly Parsing Formatted Text...

13 years ago | 0

| accepted

Answered
find index of a matrix through another matrix
This is possible if A and B are whole numbers %% A = [ 1, 3, 4, 6, 7 ]; B = [ 3, 4 ]; %% ix1 = ...

13 years ago | 0

Answered
How do you load a .csv file, skip lines within it, and plot the values?
Try data = textscan( fid, '%s%s%f', 'Headerlines', 16 ); Delimiter is obviously one or many "space" or tab. Default ha...

13 years ago | 0

Answered
there is a way that if clause it is execute
Try this: for ii = 1 : 1e7 x = rand; if x < 1E-6 disp( 'do-something' ) end e...

13 years ago | 1

| accepted

Load more