Answered
you are designing a rectangular page to contain 60 inch^2 of printing with a 4-inch marging at the top bottom and a 2-inch margin at each side.what overall dimensions will minimize the amount of paper used?
While this is valid matlab: 1 == (60/(b-4)) + 8; it doesn't do much. Without the semicolon at the end, it would just display w...

6 years ago | 0

Answered
Fibonacci sequence up to first 256 elements
See Loren's blog for an efficient way to compute the fibonacci sequence using filter. As for your question, % Calculating firs...

6 years ago | 0

Answered
How to use map and reduce efficiently?
Assuming your shares variable is numeric and assuming your grouping variables are {'rdate', 'cusip'}, t = tall(ds); [group, r...

6 years ago | 2

| accepted

Answered
Creating a Matrix from Distances between Vectors
This can be achieved easily without a loop: %demo data m = 46 n = 100 A = rand(3,m) B = rand(3,n) distance = sqrt(sum((p...

6 years ago | 0

| accepted

Answered
Group maths on for loop
The vectorised version of what you intended with your loop (but didn't achieve): R=15; r=5; epsilon=100; delta=(R-r)*(epsilo...

6 years ago | 0

Answered
Save Function does not work
If you look at the error message #031 in the hdf save, you can clearly see the problem: #031: H5FDsec2.c line 822 in H5FD_sec...

6 years ago | 1

| accepted

Answered
How can I convert table of chars to array of strings?
I imported the data from an excel sheet as categorical array. It was somewhat manual to work to create my table Yes, you made a...

6 years ago | 5

| accepted

Answered
arrayfun isreal fails - how to fix?
Note that the problem you highlight has nothing to do with isreal. I guess that you've uncovered an unexpected implementation de...

6 years ago | 2

Answered
Some confusion in my script for lsqcurvefit
You know that (the badly named) P and L are both column vectors, then you have A=P; %how about using meaningful names fo...

6 years ago | 1

| accepted

Answered
How to specify the type of the argument of the function?
If you're asking how to construct a BlockInfo object, with the current class definition, it has to be: block = BlockInfo; bloc...

6 years ago | 0

Answered
Can this be written in a much better way for fast computations?
If Joel hypothesis that "You want to look at each pixel which is mostly water, and assign a distance from the pixel to all surr...

6 years ago | 3

Answered
[Help] writetable text alignment and saving pre 0
Your question is not very clear. I'm not sure what you're referencing with it. Note that the numbers 0409, 0000000000409, 409.0...

6 years ago | 1

| accepted

Answered
Error: Index in position 1 exceeds array bounds.
You've told xlsread to import from row 607 to 1947, therefore, you'll get a (1947-607+1 = 1341) x 2 array, where row 1 correspon...

6 years ago | 0

Answered
How to find out the image name of a randomly selected image and save it to workspace by PushButton?
The code you show doesn't appear to be related to a GUI, so it's unclear how it relates to your question. how does the image na...

6 years ago | 0

| accepted

Answered
How can I find all object of a certain handle class?
I don't think there's any way to track down instances after the fact. You could however track the creation and deletion of all...

6 years ago | 4

| accepted

Answered
Meshgrid function different order
Personally, I think meshgrid is an abomination as it doesn't really makes its mind what order the dimensions are in. It iterates...

6 years ago | 1

Answered
How to assign points to multiple polygons using inpolygon
There is no point iterating over each point and each polygon. You can pass all the points at once to inpolygon. Here's how I'd i...

6 years ago | 1

| accepted

Answered
How to display images in APP DESIGNER?
If you want to display your image in a uiimage control, then simply assign the image to the ImageSource property of the control:...

6 years ago | 1

| accepted

Answered
Tall array - How can I perform conditional search and extract information
It should be as simple as: highestprice = gather(groupsummary(tt, [1, 2], {'none', 'day'}, 'max', 5)) %you can replace 1, 2, a...

6 years ago | 0

| accepted

Answered
help with basic 2048 game function
I'll be editing this answer as I read the code. ---edit: the main reason for your code not working is at the end of the answer....

6 years ago | 1

| accepted

Answered
Attempting to find patterns within my data
%demo data: A = logical([ 0 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1]) Finding the start index (in the first column) of ...

6 years ago | 0

Answered
Save data from for loop without subscript index
%... constant definitions timesteps = t0:dt:t_stop; h = zeros(size(timesteps)); %preallocate h for step = 1:numel(timestep...

6 years ago | 0

| accepted

Answered
Unable to read the last line by using regexp
As I said, your regular expression is invalid, and even corrected doesn't work very well. I also suspect that the (\r) was meant...

6 years ago | 1

| accepted

Answered
How can I get the indices of values meeting a condition in a tall array?
Maybe find is not working on tall since I use 2017b Indeed, support for using find on tall arrays was added in R2018a. As for...

6 years ago | 2

Answered
A doubt regarding a simple For loop indexing for certain rows only.
Since nobody has explained why your code doesn't work: There are several problems with your if a(c, [1:4]) == [1, 2, 3, 4] | [...

6 years ago | 1

| accepted

Answered
How to solve "Subscripted assignment dimension mismatch"?
Off by one error, 279:322 is 44 elements not 43. Same for all the other indices, you've got one more element than required. Any...

6 years ago | 0

| accepted

Answered
Out of memory. The likely cause is an infinite recursion within the program.
You, or some code you've downloaded is shadowing the isrow.m function of matlab. Hopefully, the isrow.m you've deleted is not t...

6 years ago | 1

| accepted

Answered
How to select a group of consecutive (yet excluding weekends and holidays) dates between a certain date A and a certain date B from datetime?
If I understood correctly, use the isbetween function: %bus_dates: a datetime vector of all business dates between 2012 and 201...

6 years ago | 0

Answered
Error using str2func Error: This statement is incomplete
So, instead of writing a program to solve a problem, you are writing a program that writes a program that solves a problem. As a...

6 years ago | 1

| accepted

Answered
How can I apply ndgrid in loop?
It's not any clearer what you want, since you don't define what you mean by multiply and since ndgrid has nothing to do with mul...

6 years ago | 0

| accepted

Load more