Community Profile

photo

Stephen Cobeldick


4,373 total contributions since 2014

Suspensa Vix Via Fit

Stephen Cobeldick's Badges

  • Master
  • 36 Month Streak
  • Thankful Level 4
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

View details...

Contributions in
View by

Answered
how can i rotate a figure without using the figure window but using code
Use <https://www.mathworks.com/help/matlab/ref/view.html |view|>, e.g. view(180,90)

4 hours ago | 0

Answered
From a vector to a 3D array
Taking a guess that this is the order that you want: >> new = permute(reshape(vector,[5,6,4]),[2,1,3]) new(:,:,1) = ...

7 hours ago | 0

Answered
indexing a vector in a loop
This is much simpler and more efficient that your idea of magically accessing variable names. I simply <https://www.mathworks.co...

7 hours ago | 0

Answered
how to extract a specific text from text file
>> C = {'1;158.798;281.117;99.858;39.855;2182;'}; >> D = regexp(C,';','split'); >> D{1}(2:5) ans = '158.798' ...

9 hours ago | 1

| accepted

Answered
How to sum multiple matrices?
_"I'm new in matlab and I need some help please. I have 12 matrix s1...s12..."_ That is the problem right there. Numbered var...

9 hours ago | 0

| accepted

Answered
openfig has the error 'The value of 'Filename' is invalid. It must satisfy the function: ischar.'
You used the wrong indexing for the cell array. You need to use curly braces: openfig((f_range_name{I})) ...

10 hours ago | 0

Answered
Brace indexing is not supported for variables of this type. Error in cell2mat (line 36) if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1}) Error in NRMVRR (line 13) m=cell2mat(f);
I fixed up the first part of your code. Your code has many bugs, you actually need to read the MATLAB documentation to learn how...

10 hours ago | 0

Answered
Fixunknowns function resulting logical rows
Where |M| is the output matrix: new = M(1:2:end,:)

10 hours ago | 0

| accepted

Answered
find if the variable exists in a given cell-structure
Use <https://www.mathworks.com/help/matlab/ref/isfield.html |isfield|> to test if a structure has a particular field: isfie...

11 hours ago | 0

| accepted

Answered
Using a variable name as the name of a file structure
Although your explanation is not very clear, it seems that your |.mat| file contain one variable, which happens to be a structur...

24 hours ago | 0

Answered
how do i write a for loop to eliminate point under a certain value?
With basic indexing: Ti_x(Ti_x<=0.25) = NaN NaN values do not get plotted.

1 day ago | 0

| accepted

Answered
Suppose i have matrix the first and second column represent x,y-coordinates and third column is cluster id
*Method One:* <https://www.mathworks.com/help/matlab/ref/accumarray.html |accumarray|>: >> R = 1:size(M,1); >> C = accum...

1 day ago | 0

| accepted

Answered
Reading 100 image in a loop and save them in a Matrix
You should follow the examples in the MATLAB documentation, rather than using awful |eval| and |cd|: <https://www.mathworks.c...

1 day ago | 0

Answered
Error using vertcat Dimensions of arrays being concatenated are not consistent.
The problem is how you have written your vector with random space characters. For example this: 1.7e-3 -(y(12))*(y(14))/(y(...

1 day ago | 1

Answered
How to read input images from the folder sequentially
Presumably the files have numbers in them, and you are getting them back _not_ in numeric order... then simply *download* my FEX...

1 day ago | 0

Answered
Could anyone help me to solve the issue
You need to actually look at the data that you are plotting: what magnitude do they have? Your data are of order 1e13, 1e9, and ...

1 day ago | 1

Answered
How to combine 3 (or more) separate CSV files into one Excel file with multiple sheets
D = 'path of folder where the CSV files are'; S = dir(fullfile(D,'*.CSV')); for k = 1:numel(S) mat = csvread(full...

2 days ago | 0

| accepted

Answered
i want to save names of the images(frame_0000, frame_0001, frame_0003........) in a text file by reading them from a folder.
D = 'directory where images are'; S = dir(fullfile(D,'*.jpg')); % Save filenames: [fid,msg] = fopen('names.txt','wt')...

2 days ago | 1

| accepted

Answered
Writing ASCII symbols by using fprintf
Windows only: [fid,msg] = fopen('file.txt','wt'); % open in text mode! assert(fid>=3,msg) fprintf(fid,'...\n',yourArr...

2 days ago | 0

| accepted

Answered
how to write a code in which the output of a one function will be out put to an other function.?
This is easy, assuming that each function has just one input and output. Try this: C = {@fun1,@fun2,@fun3,@fun4,@fun5}; % c...

2 days ago | 1

Answered
rounding a column vector
This will round values from (X-1).9 to (X).1 to the integer X, otherwise leave the rounded values alone: >> vec = 1:0.1:2 ...

2 days ago | 1

Answered
Vector/martix limit size?
Your code is buggy, and that concept will fail for 3D arrays. Try this instead: isrow(v) && numel(v)==3 OR isequal(...

2 days ago | 0

| accepted

Answered
Read a vector from Excel and use it in several functions in a code
Pass the data as input arguments. This is explained well in the MATLAB documentation: * How to define functions with input ar...

2 days ago | 0

Answered
How can I preallocate for speed instead of concatenating changing size column vectors in a loop?
Doing everything with loops is not an effective use of MATLAB. Here I used some basic vector operations and |repmat| to replace ...

2 days ago | 0

| accepted

Answered
Write in Excel file huge matrix
Excel simply cannot display that many rows, no matter how much you want it to. _"...even if Matlab tells me it works, when I ...

2 days ago | 0

| accepted

Answered
Storing data in for loop
Get rid of the most of the loops, they don't help you. Learn how to write vectorized code. Here is your code, simplified: m...

2 days ago | 1

Answered
how to read a txt file having alphanumeric data and special characters. ? My text file is like this. I tried textread but could not get a result. any suggestion.
Here is an efficient solution using <https://www.mathworks.com/help/matlab/ref/textscan.html |textscan|>. The test file is attac...

2 days ago | 1

| accepted

Answered
How do I threshold only real part of a complex matrix?
>> A = complex(randi([-3,3],4,4),randi([-3,3],4,4)) % fake data A = -2 + 3i -2 + 1i 2 - 3i -2 + 1i -2 + 0i ...

2 days ago | 0

| accepted

Answered
How to set multiple variables at once?
_"I wonder if I can set multiple variables at once"_ Not in the way that you are trying to do, because MATLAB is not Python (...

2 days ago | 0

| accepted

Submitted


CubeHelix Colormap Generator: Beautiful and Versatile!
The most versatile colormap generator ever! Generate colormaps suitable for grayscale conversion.

3 days ago | 23 downloads |

Thumbnail

Load more