Answered
Why are my images not displaying correctly?
First, you need to learn to vectorise code, the lines: for i=1:x for j=1:y g(i+1,j+1)=f(i,j); end end can ...

7 years ago | 0

Answered
Separate one column in an imported matrix
The way I'd do it: t = readtable('test11_1.txt'); %import as table t.PointIDs = rowfun(@(s) sscanf(s, '%f,', [1 Inf]), t, 'In...

7 years ago | 1

| accepted

Answered
Create vertex with edges.
Your question is so vague that it's impossible to answer it properly. The only thing we can do is point you to the <https://...

7 years ago | 0

| accepted

Answered
I need help with this question
Well, have you tried to run your code? There's a syntax error on the first line that you can correct yourself easily. Once you'v...

7 years ago | 0

Answered
Import function automatically converting the datenum values
Your attempt, |datetime(opts,'InputFormat', 'dd/MM/yyyy hh:mm');| tries to convert the import options to datetime which of cours...

7 years ago | 2

| accepted

Answered
I have finished my script but i want to simplify it instead of leaving it looking cluttered, I am mainly looking for a shortcut.
Cluttered! What would you do if you had to plot the values from 0 to 10,000? Copy/paste the same lines 10,000 times and edit the...

7 years ago | 0

Answered
Stuck on rewriting program to use nested if constructs
For reference, one way to do this in matlab without any |if| at all, in just one line: fun = x.^(1 + (x<0)) + y.^(1 + (y<0)...

7 years ago | 0

Answered
Image Processing with data of type single
Despite your statement, at some point, the image must have been converted from integer type to single, and the conversion wasn't...

7 years ago | 0

Answered
How to change data type of table in matlab
Really, you should change the way you store your data in the spreadsheet. As it is you're losing most of the benefit of the spre...

7 years ago | 1

| accepted

Answered
String variables in uitable
Note: since R2016b, string is a proper matlab type, delimited by double quotes |"|. What you have are char arrays. In parti...

7 years ago | 0

Answered
Error using +. Matrix dimensions must agree
The error message is very clear, you're trying to add two matrices of different size, which is never possible. Since |b1| is a 1...

7 years ago | 1

| accepted

Answered
Extracting data in specific time intervals
Since it appears your data is stored in a timetable, the simplest way would be to call <https://www.mathworks.com/help/matlab/re...

7 years ago | 1

Answered
Why Matlab can't read .csv or .mat files?
On your windows computer, I suspect that you have a |table.m| file somewhere on your path shadowing the built-in table class. Ge...

7 years ago | 3

| accepted

Answered
Error while opening matlab GUI
Right now, the error you're getting is from line 66: set(handles.dataSetPopUp,'String',mat2cell(1:8)); and matlab is tel...

7 years ago | 0

Answered
How to create a for loop where is if condition for each n-th value in i
First, let me say that the proper way to code your algorithm is without a loop an I'll show how to do that at the end. Even with...

7 years ago | 0

Answered
I have a cell array of 13 x 13 cells and every cell contains 16 x 16 double. How i can convert the full cell array into matrix of 208 x 208 ? Thanks in advance.
Your question is very puzzling: * You already know the answer to it, you've already written the code to do it, it's simply: ...

7 years ago | 1

Answered
drop down return to the first option
If you're using a |uidropdown| in app designer, at the end of your callback, after you've emitted your sound, set the dropdown <...

7 years ago | 0

| accepted

Answered
How to return corresponding element in two same same size matrices
Your |x(YRow)| doesn't work because matlab doesn't know that you want element |YRow(1)| to be taken in the first column, |YRow(2...

7 years ago | 0

| accepted

Answered
My answers are displayed in index form, how do I remove this?
format longg or format shortg should avoid displaying numbers in exponential form (this has nothing to do with ind...

7 years ago | 0

| accepted

Answered
Why does image function always delete tag of axes control ?
I gave a thorough explanation in a <https://uk.mathworks.com/matlabcentral/answers/428478-get-coordinates-from-image-imagesc-in-...

7 years ago | 1

| accepted

Answered
How can I randomly select words from a column without replacement?
Use |randperm| properly. |randperm(x, 1)| is the same as |randi(x)| and of course if you do that 3 times, there's no guarantee y...

7 years ago | 0

Answered
Average every 6hrs of hourly values - one month of data with missing data
Assuming that |readtable| detects the format of your file properly, it would be as simple as: t = table2timetable(readtable...

7 years ago | 0

| accepted

Answered
How to move files with name containing 1,7,13, 1+6n to a new folder?
_I have no clue how to perform it_ Well, neither do we until we start to think about the problem, deconstruct it into steps a...

7 years ago | 0

| accepted

Answered
Use c Code in Matlab and deal with pointers
I know nothing about coder but I don't understand why you're structured your current code the way it is. From the C-code point o...

7 years ago | 0

Answered
How to save segmented images into different folders?
Well, clearly the code you wrote has a bug but it's hard for us to tell you the problem if you don't show us the code. It is ...

7 years ago | 1

| accepted

Answered
Import and plot file with day and time information
I'm not sure what you're doing wrong since you haven't shown us what you're doing. The following may be what you're after: ...

7 years ago | 2

| accepted

Answered
Slice along a curved plane
_how can I get a slice along a curved plane_ Just pass a matrix of location for your x and y slice location instead of fixed...

7 years ago | 0

Answered
How to sum the values from multiple arrays with the same dimensions?
Use + ? result = array1 + array2 + array3 + array4; %of course using the actual names of the arrays However, it sounds ...

7 years ago | 0

| accepted

Answered
Get coordinates from image (imagesc) in guide
There are two parts to your problem. The first reason you see this behaviour is because you're using the <https://www.mathwor...

7 years ago | 1

| accepted

Answered
How can I edit the output of xlsread to make each column of the Excel file a single variable in a structure?
Note: Use |~| to ignore a function output instead of creating a |dummy| variable. So: [~, myName] = fileparts(files(k).nam...

7 years ago | 0

Load more