Answered
Help with matlab, dimensions of matrices being concatenated are not consistent, why?
Seeing what you are trying to do in the call to plot, I suspect that you didn't want to solve a linear system when you defined |...

10 years ago | 0

| accepted

Answered
urlread function: put variable in string
You can concatenate strings using square brackets, but I usually prefer building a final string using SPRINTF, e.g. url = sp...

10 years ago | 1

| accepted

Answered
extracting specific part from txt file
It is difficult to understand what "for each .." means in your question. If you just need to extract the numbers that you specif...

10 years ago | 1

| accepted

Answered
order a cell array by the dimension of its cells
Here is one way: Build test data: >> c = {randi(10,1,3), randi(10,1,4),randi(10,1,2),randi(10,1,3)}' c = [1x3 dou...

10 years ago | 2

| accepted

Question


Is there a "signature" for objects instances of subclasses of handle?
Dear all, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assume that we have a class |MyClass<handle|. Is there a "kind of signature" th...

10 years ago | 1 answer | 1

1

answer

Answered
Why is MyCellArray{:} different than x = MyCellArray{:}?
|MyCellArray{:}| is a Comma Separated List (CSL). It is the information that you are missing I guess. The |x| on the left hand s...

10 years ago | 2

Answered
Getting help for a function from another function
As mentioned in my comment above, you could write a small code manager tool which performs this kind of updates for you. I often...

10 years ago | 0

| accepted

Answered
Repeated printing of output when the code is run. How to change to print it only once?
This is because MEAN works along a dimension (the 1st by default) and not over the full array. See below: >> A = rand(3, 4) ...

10 years ago | 2

| accepted

Answered
Assinging String Value to Structure
Here is one way: [unshuff(1,:).myfield] = deal( 'new practice' ) ;

10 years ago | 0

| accepted

Answered
how the function typecast works when convert double to uint8
Look at the difference between CAST and TYPECAST, and you will understand what happens in your example. PS: if you want to un...

10 years ago | 1

| accepted

Answered
Most efficient way of tackling this problem
Here is the beginning of an answer while I am waiting for my plane. "Most efficient" can have multiple meanings here. Does i...

10 years ago | 1

Answered
Creating discrete variables within a for loop
*UPDATED* Here is a fun (maybe) example: nShapes = 10 ; nFrames = 100 ; % - Build figure and axes. figure() ; s...

10 years ago | 1

Answered
Please im having this messeage displayed when using xlswrite function
This is a warning that informs you that you are operating on a spreadsheet that doesn't exist, and hence adding it to the workbo...

10 years ago | 5

| accepted

Answered
Remove row in cell array depending on value of first column.
The easiest way is using a loop: for cId = 1 : numel( C ) isLt6 = C{cId}(:,1) < 6 ; C{cId} = C{cId}(~isLt6,:) ; ...

10 years ago | 0

Answered
How to use dir in a loop to be dynamic?
We actually use DIR the other way around. If file names are very regular and determined by e.g. a number, we built them using SP...

10 years ago | 2

| accepted

Answered
Is there any way to identify the fingerprint contents in an image using matlab?
Here is a lightweight approach that is absolutely not solid/stable; .. could be a starting point? I = imread( 'fingerprint00...

10 years ago | 2

| accepted

Answered
set legend to non transparent
What do you mean by opaque? By default the legend is boxed and opaque: >> t = 0 : 0.1 : 10 ; plot( t, sin(t), 'b', t, cos(t...

10 years ago | 1

Answered
Export matched lines from two text files
Here is a first draft. Test it and let me know if anything is unclear or doesn't work. % - Read files content as strings. ...

10 years ago | 1

| accepted

Answered
What is the best approach in editing script files with other script files ?
You can do something along the following line. As you don't have 4 columns in your Excel file, I assume that the former values c...

10 years ago | 1

| accepted

Answered
How to create subplots with little vertical spacing?
You can store/use the axis handles of both subplots and access/modify their properties. Here is an example: t = 0:0.1:10 ; ...

10 years ago | 15

Answered
How to import hex values from text file?
*EDIT:* I updated my answer with comments and made it a little more efficient. buf = fileread( 'chromebackground_0_150810-14...

10 years ago | 0

| accepted

Answered
Exporting matched lines from a text file
Because your file contains no new line characters (\n = ASCII 10) but only carriage return characters (\r = ASCII 13). After you...

10 years ago | 0

| accepted

Answered
How to define new methods on existing matlab classes?
Generally speaking, you *cannot* do it. You cannot subclass MATLAB fundamental classes. You may want to try building your ow...

10 years ago | 0

Answered
Heat map of a 1999x1000 matrix of values, x and y positions given by separate 1999x1000 matrices?
The problem is that you don't have a regular grid. If you had one, you could remap elements of |x|, |y|, and |z| according to tw...

10 years ago | 0

| accepted

Answered
Character restriction in text file
If you want to keep only the lines which start with the character |M|, the following would work: content = fileread( 'BTM.tx...

10 years ago | 0

Answered
Search entire multi level cell array for matching string
If you have 2015a or above, this can be an occasion for playing with the new REPELEM function: linId = strcmpi( [MyCellArra...

10 years ago | 0

Answered
extract data from each row in a matrix if all columns in that row above a threshold
Here is an example: >> A = randi( 20, 10, 5 ) % Dummy example. A = 17 4 14 15 9 19 20 1 ...

10 years ago | 1

| accepted

Answered
Multiplying the row numbers and column numbers, NOT THE ELEMENTS iN THEM
Assuming e.g.: nRows = 5 ; nCols = 8 ; you can do it this way: prods = bsxfun( @mtimes, (1:nRows)', 1:nCols ) ; ...

10 years ago | 1

| accepted

Answered
Removing unwanted lines from text file
Not far! You made two small mistakes actually. The first is that you have 7 columns, and hence 6 separators, so the array of sep...

10 years ago | 0

| accepted

Answered
Reading in data with spaces
Here is a quick fix following a different path from what is mentioned in Dpb's thread. Assume that we have |test.txt| with the f...

10 years ago | 1

| accepted

Load more