Answered
Use of arrayfun and sprintf to order data
1. Create a function to filter the relevant fields of the structure: function filtered = filterstruct(unfiltered) %FI...

10 years ago | 0

| accepted

Answered
Word Guessing game code, with a bit of a twist. (matlab)
With regards to your latest comment: char('A' + randi([0 25])) will give you a random uppercase letter. It is trivial to...

10 years ago | 0

Answered
How to create a 65336x1 double matrix from a 256x256 double matrix?
Use the <http://www.mathworks.com/help/matlab/ref/colon.html colon operator>, or <http://www.mathworks.com/help/matlab/ref/resha...

10 years ago | 0

Answered
How to color the area based on the number of people living in.
Here's how you could convert your image into a labeled array: areaimage = imread('test.jpg'); %read in the image as jpg (R...

10 years ago | 2

| accepted

Answered
How to covert a cell to multiple line string?
Use |char|: cellarrayofstring = {'some'; 'strings'; 'to'; 'convert'; 'to'; 'a'; 'char'; 'array'} chararrayofstring = cha...

10 years ago | 1

Answered
How do I decrease a 1x1 structure with 92 fields to a 1x1 structure with 12 fields?
Of course! Computers are very good at doing repetitive tasks as you have here: fn = fieldnames(Temp); %get list of fields o...

10 years ago | 0

Answered
Create a Matrix from a cell array
Your post is not very clear, not help with the fact that your example does not use valid matlab syntax. Possibly, that's what yo...

10 years ago | 1

| accepted

Answered
log used function names in a MATLAB program
You could simply use the <http://www.mathworks.com/help/releases/R2016a/matlab/ref/profile.html profiler> which will return the ...

10 years ago | 0

| accepted

Answered
How can I Stack data in a Table
I'm not sure |stack| can produce the output you want, but with only two different categories to stack a manual extraction would ...

10 years ago | 0

| accepted

Answered
Why only first character of string is writing into .csv file
As per Stephen's comment *do not use* the automatically created |ans| variable| to get to the output of functions in your code. ...

10 years ago | 1

| accepted

Answered
what is the mathlab option for windows 32 bit configuration
As per <http://uk.mathworks.com/support/sysreq/roadmap.html Mathwork platform roadmap> the last version that supported 32-bit wi...

10 years ago | 1

Answered
Why do I get the error"Not enough input arguments."
You appear to have a mixture of a script and a function in the same file. Unless you're using the just released R2016b, this is ...

10 years ago | 0

Answered
How to vectorize(?) user defined function with vector inputs.
If you really want to vectorise your code, then it is indeed |myfunc| that needs to be modified as per Andrei's answer. Without ...

10 years ago | 0

Answered
combine celle array of cell array vertically
This cellfun(@(col) vertcat(col{:}), num2cell(ABC, 1), 'UniformOutput', false) or arrayfun(@(col) vertcat(ABC{:, ...

10 years ago | 1

| accepted

Answered
nchoose2: save output in chunks?
Neither |nchoosek| nor <http://uk.mathworks.com/matlabcentral/fileexchange/20144-nchoose2--v2-1-jun-2008-/content/nchoose2.m |nc...

10 years ago | 1

| accepted

Answered
How to reduce the precision of calculations in Matlab?
If you are really limited to 14 bits for real numbers, then probably you should be used <http://uk.mathworks.com/help/fixedpoint...

10 years ago | 0

Answered
Concatenating n number of doubles
vertcat(yourstruct.filterindex) should work. See also <https://www.mathworks.com/help/matlab/matlab_prog/access-multiple...

10 years ago | 1

Answered
Extract 3D cells with nonzero elements, from a 3D cell array.
Well, if you want nice and concise: filteredmask = Combinedmask(:, :, any(any(Combinedmask, 1), 2)) No need for cell arr...

10 years ago | 2

Answered
i want to create an excel sheet for A=14/(cos(b))^3,where b varies from 8 to 25(i.e 8,9 ....,25). How to write a programme ?
Well, if you really want to do it in matlab, the efficient way of doing it is: b = 8:25; A = 14/cos(b).^3; xlswrite('...

10 years ago | 0

Answered
I am trying to shuffle the pixels of an image using chaotic standard map.But I got an error "Subscript indices must either be real positive integers or logicals."
Well, the problem is obvious. You're essentially doing r(2) = j + K * sin(x) Since sin is a real number between -1 and 1...

10 years ago | 1

| accepted

Answered
How to rewrite a conditional recursive funtion without for-loop
I don't think you can avoid the |for| loop because of your condition. The only optimisation that I can see is precalculating th...

10 years ago | 0

Answered
"end-1" as parameter
Well, |end-1| is *not* an unknown location. It's the element before the last. There are plenty of scenarios where you'd want the...

10 years ago | 1

| accepted

Answered
How can extract specific numbers from a string???
You could use a <http://www.mathworks.com/help/matlab/ref/regexp.html regular expression>. Assuming all the numbers you want to ...

10 years ago | 0

| accepted

Answered
How to extract rows from matrix in a for loop?
*Within the loop*, |profrow| does contain the ith row as you indeed want. Your code is correct. |t| is then the ith element of t...

10 years ago | 1

| accepted

Answered
Event listener for multiple draggable rectangles using imrect in matlab
Do you really want to listen to all the changes in position of the rectangles? There will be a lot of event recorded when the us...

10 years ago | 1

| accepted

Answered
How can i create random rectangles (automatically)?
This will create as many rectangles as you want in any range you want: numrects = 100; %choose your own value mi...

10 years ago | 1

| accepted

Answered
Write a function to extracts number between 2 letters?
This is trivial with a <http://www.mathworks.com/help/matlab/ref/regexp.html regular expression>: nstr = regexp(filename, '...

10 years ago | 0

Answered
Can i monetize (sell) anything i made using matlab with an academic license?
The only entity that can answer that question with any kind of authority is Mathworks, so you should ask them directly. My un...

10 years ago | 0

| accepted

Answered
How to plot a histogram from 0-255
See <http://www.mathworks.com/help/images/converting-between-image-classes.html the documentation on image classes>. Most ima...

10 years ago | 0

Answered
Can I convert long binary strings into unique serial numbers of much shorter length?
Considering that encryptions keys are now getting to 2048 bits or more, 1000 bits is not that long. How about grouping your b...

10 years ago | 0

| accepted

Load more