Answered
Random shuffle vector such that all elements fall in new index positions
I would: do a normal randperm that may map some elements back to their original location any element that has been mapped to ...

6 years ago | 0

Answered
Trying to decrypt a message
tofind = '[a-zA-z#]' Read the regexp doc and its examples to learn how ranges work. You may want to add a quantifier to the e...

6 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (0). Error in ROI_timecourse_DICOM_v2_0 (line 20) FullFileName = FileName(1:suffix(1)-5);
Most likely, strfind(FileName, '.') didn't find a . so suffix is empty and of course suffix(1) is invalid since index 1 is more ...

6 years ago | 0

Answered
Convert Binary matrix to Double Value
Bearing in mind that for A = [0 0 0 0 0 0] B is just 0 and that above 16 bits you don't have enough precision in a double number...

6 years ago | 0

Answered
Large, unused cell aray in memory still slows down calculation significantly
Well, with the cell array you're doing 2x44100 matrix allocations with zeros, which all have to be copied into a new complex mat...

6 years ago | 0

Answered
When merging two tables, then restart the number of rows
No, as you've stated the row number is not part of the table, it's only there to help you in case you need to index the table ro...

6 years ago | 0

Answered
How do I import and read multiple text files with the same name from different folders
datafolder = 'C:\somewhere\somefolder'; %your root data folder dataname = 'RESULTS_TRIALS.txt'; %replace with appropriate ext...

6 years ago | 0

| accepted

Answered
Getting cell array of structs to a usable form in R
destination_folder = 'C:\Somewhere\somefolder'; %change as appropriate filepattern = 'Drive%02d.csv'; %change pattern if need...

6 years ago | 2

| accepted

Answered
Monte Carlo Method Fails
Monte carlo works fine. Clearly you have a bug. Why are you shuffling (with randperm) each suit before concatenating them? Woul...

6 years ago | 0

| accepted

Answered
Remove elements from string array
One possible way: numericarray = double(yourstringarray); %convert string array to numeric. Text that can't be converted to nu...

6 years ago | 0

Answered
How can I compute a point-by-point difference between a RAND and RANDN matrix?
"I honestly don't even know where to start, my instructor never went over what "seed" means" Have you tried searching matlab's ...

6 years ago | 0

Answered
Select method of Worksheet class failed
I'm sure the author is vey good at her research but a good programmer she's not. Global variables in every single function, what...

6 years ago | 0

Answered
How can I interpolate a data set given by 5 "inputs"?
TLDR: The Y and xq you've constructed work for scatteredInterpolant but not for griddedInterpolant which uses a different format...

6 years ago | 0

| accepted

Answered
Getting error for this code as Index in position 1 exceeds array bounds. Pls tell solution
Most likely, your image is smaller than 512x512. If that's not the problem then give us the entire text of the error message. ...

6 years ago | 0

Answered
How to create another vector based on some if condition?
It's rare to have to use if in matlab, and it's certainly not the route to go if you want to operate on whole vectors or matrice...

6 years ago | 0

| accepted

Answered
global variables in structure
Hopefully, you ]do not have any global variables. Global variables are typically a very bad idea. However, I think you're just ...

6 years ago | 0

| accepted

Answered
how to split data with 'or' condition ?
My recommendation would be not to split your data into cell arrays. You're complicating your life for no reason. First, you sho...

6 years ago | 0

Answered
difference between x and 'x'
What a strange question! x is the variable you previously defined, so x*2 multiply the content of the variable by 2. 'x' is a ...

6 years ago | 0

| accepted

Answered
Indexing Elements in an Array
Apart from a blackboard, I'm not aware of any language where a < b < c is the proper way to test if a number is between two oth...

6 years ago | 0

Answered
how to remove zeros from the matrix?
A=[1, 0, 2, 0, 3 ; 0, 4, 0, 5, 0 ; 6, 0, 7, 0, 8]; B = reshape(nonzeros(A(:, 1:end-1).'), [], size(A, 1)).'

6 years ago | 2

Answered
changing value in the center of an array
What's an LPF filter? Possibly, is it a Low Pass Filter filter? I don't understand what you're trying to achieve with this x_2...

6 years ago | 0

| accepted

Answered
How does one rotate the bottom half of an image 180 degrees while keeping the upper half the same?
Use indexing to get the half of your image that you want to rotate, e.g. assuming the height of your image is a multiple of 2 l...

6 years ago | 0

| accepted

Answered
how can I edit a matrix and rename it at the same time?
Sorry, you're better off doing it in two lines. You want to copy the matrix into the new variable before changing it so: edited...

6 years ago | 0

| accepted

Answered
Copy the content of one table to an other table with different size
This is trivially done with outerjoin: mergedtable = outerjoin(yourbigtable, yourgroupcounttable, 'Keys', {'Time', 'radius'}, '...

6 years ago | 2

| accepted

Answered
OpeningFcn of AppDesigner Conversion?
I've no idea how the tool converts a GUIDE GUI into an App, but in App Designer all the initialisation code goes in the StartupF...

6 years ago | 0

Answered
how can i change an indice in Matrix as vector?
First, probably the most important thing: numbered or sequentially named variables are always a very bad idea. they always make ...

6 years ago | 2

Answered
somebody plz help me with this code. I got an error after run this code is subscript indices must either be real positive integers or logical.
%your code: left=find(difsig==1); raight=find(difsig==-1); So left and the mispelled raight are a vector of indices of di...

6 years ago | 0

| accepted

Answered
how to use cell ?
If you're asking how to transform U into your desired F: F = cellfun(@num2cell, U, 'UniformOuput', false); would be one way of...

6 years ago | 1

Answered
fill a boundary region with white colour
boundaries{2} is only two pixels, there's nothing to fill! Anyway, if all you want is to fill the region, then bwboundaries is ...

6 years ago | 1

Answered
How to enforce element-wise condition in matrix operations?
Reposting my comment as an answer and adding a bit more to it. I'm unclear why you want to ignore the 0s in L and why you think...

6 years ago | 1

| accepted

Load more