Answered
Save variable to .mat file
try this: save(strcat(Name,'_waviness'),'waviness')

4 years ago | 0

Answered
How to reference points in time in a matrix?
a=[ 0 0 0 0] a=[a; 0 0 0 0] a=[a; 0 0 0 0] a=[a; 0 0 0 0] a=[a; 0 ...

4 years ago | 0

| accepted

Answered
Identifying missing values in matrices
try idx=~ismember(B,A) C=A(idx)

4 years ago | 0

| accepted

Answered
load data cell from Mat file from Matlab file
clearvars; clc; ss=load('matlab_t.mat','unnamed'); %% I would like this to be ss=[1;2;3] ss=ss.unnamed

4 years ago | 0

Answered
How to make unfilled plot points?
Think you'll find it's due to the linewidth - change it to 1 and they shouldn't be filled. MarkerSize changes the size of the po...

4 years ago | 0

| accepted

Answered
rng() throwing error
Not really sure: only thing that springs to mind is something shadowing the Matlab function? what do get when you type: which ...

4 years ago | 1

| accepted

Answered
How to remove vectors values with restraints?
A = [ 0.1 0.2 0.4 0.6] B = [ 0.5 0.9 0.6 0.2] C=(A+B)<1 A=A(C) B=B(C) C = 1×4 logical array 1 0 0 ...

4 years ago | 0

Answered
How to save the results of all iterations?
Something like this? R=1.1/100; %m k=1; %W/m.K rho=1100; %kg.m^3 Cp=4180; %J/kg.K h=2700; %W.m^2.K ...

4 years ago | 0

| accepted

Answered
For Loop Indexing exceeding array elements
First run of the loop you are overwriting the z vector with a scaler if k <= 1 z=5; mu = 0; On...

4 years ago | 0

Answered
how to save the results obtained by a for loop repeated n times
AC = [100 2; 110 4; 105 3; 130 7; 120 5; 115 5; 115 3; 140 7; 110 9; 105 4; 110 3; 120 5 ]; A = 3; function [C] = Trend(A...

4 years ago | 0

| accepted

Answered
Multiplication of elements of matrix without using for loop
A.*B ans = 1.0000 1.0000 0.9999 0.2500 0.4000 0.4998 0.1400 0.2400 0.3333

4 years ago | 0

| accepted

Answered
Explanation of num2str(x) - '0'
num2str(x) - this converts the number to a string Once converted subtracting '0' subtracts the character code for 0 from all ...

7 years ago | 1

Answered
How do I display list of folder (as text file)
files=dir sprintf('%s \n',files.name) fName=input('choose file:','s')

7 years ago | 1

| accepted

Answered
How to delete columns if there is'nt enough data?
prunedData = rmmissing(dataMatrix,2,'MinNumMissing',13)

7 years ago | 0

Answered
How to add a small random number to all values in a matrix
testMatrix=[1 2 3;4 5 6;7 8 9] noise=(rand(size(testMatrix,1),size(testMatrix,2))-0.5)./5 testMatrix=testMatrix-nois...

7 years ago | 1

| accepted

Answered
Legend title only without marker and lines of data
Looks like the text position is consistently in the upper right (irrespective of range scale values) to me, but if you say you'v...

7 years ago | 0

| accepted

Answered
How do i make different matrices run through the same code?
If your 2D matrices are of the same dimension they can be combined into a single 3D matrix: D(:,:,1)=matrixA D(:,:,2)=ma...

7 years ago | 0

| accepted

Answered
Finding how mych values contain a specific number in a matrix
Whilst I can admire the brevity of Walter's code, I might be inclined to use a more 'conventional' alternative A=rand(100...

7 years ago | 0

Answered
How would i store data into a vector
numElements=10; %Create 1x10 row vector filled with zeros rowVector=zeros(1,numElements) %Create 1x10 column vect...

7 years ago | 0

| accepted

Answered
Can I change the loop size inside the loop?
For loop conditions are set upon entering the loop and the only form of modification that can be made is to 'break' out of the l...

7 years ago | 0

Answered
How can I write log(e) in MATLAB?
I assume you mean log10? In Matlab log is base e, so log(e)=1 x=log10(exp(1))

7 years ago | 2

| accepted

Answered
"Function definitions are not permitted in this context."
If you have a function in a script (allowed from R2016 onwards I think), it must go at the end, after all the script code

7 years ago | 0

Answered
All possible pairs in a vector
nchoosek(A,2)

7 years ago | 1

Answered
Matrix indexing - Picking columns
Do you mean this instead of your 1:5:end? 5:5:end If you explicitly also want column 1 the you could use [1 5:5:end]

7 years ago | 1

| accepted

Answered
How to run the code?
From the overview given by your link, the main function is: function [digest, MSG_PADDED] = image_hash(V_LEN,H_LEN,METH,IMG...

7 years ago | 0

| accepted

Answered
Function that pulls a name from a list at random but doesn't repeat
listNames={'a','b','c','d','e','f','g','n','h'} for iter=1:9 name=pick_name(listNames) end functio...

7 years ago | 0

| accepted

Answered
How to find a location of a specific value inside a matrices that is 26x7x101 of length
[~,loc]=ismember(matrixName,value) [i,j,k]=ind2sub([26,7,101],find(loc,1)) The above will find the first specified...

7 years ago | 1

| accepted

Answered
How do I print the common elements in a row vector?
use the logical vector to index the common values common=A(ismember(A,B)) if you have multiple values in A that are the ...

7 years ago | 0

Answered
Check values under a certain threshold with an undefined window
A=[9 10 47 50 49 48 2 46]; mymax=max(A); % in this case mymax=50 mincondition=mymax*0.9; % mincondition=45 indexe...

7 years ago | 0

| accepted

Answered
How to process a subset of a matrix
matrixName(2,:)=matrixName(2,:)/2

7 years ago | 0

| accepted

Load more